v = this[k]; switch (typeof v) {
case 'object':
// Serialize a JavaScript object value. Ignore objects that lack the
// toJSONString method. Due to a specification error in ECMAScript,
// typeof null is 'object', so watch out for that case.
if (v) {
if (typeof v.toJSONString === 'function') {
a.push(k.toJSONString() + ':' +
v.toJSONString(w));
} } else {
a.push(k.toJSONString() + ':null');
} break;
case 'string': case 'number':
case 'boolean':
a.push(k.toJSONString() + ':' + v.toJSONString());
// Values without a JSON representation are ignored. }
} } } else {
// Iterate through all of the keys in the object, ignoring the proto chain
// and keys that are not strings. for (k in this) {
if (typeof k === 'string' &&
Object.prototype.hasOwnProperty.apply(this, [k])) {
v = this[k]; switch (typeof v) {
case 'object':
// Serialize a JavaScript object value. Ignore objects that lack the
// toJSONString method. Due to a specification error in ECMAScript,
// typeof null is 'object', so watch out for that case.
if (v) {
if (typeof v.toJSONString === 'function') {
a.push(k.toJSONString() + ':' +
v.toJSONString());
} } else {
a.push(k.toJSONString() + ':null');
} break;
case 'string': case 'number':
case 'boolean':
a.push(k.toJSONString() + ':' + v.toJSONString());
// Values without a JSON representation are ignored. }
} } }
// Join all of the member texts together and wrap them in braces.
return '{' + a.join(',') + '}'; };'>
鼠标移到蜡烛人上
用搜狐小纸条开聊!