diff --git a/src/Console/Log.es6 b/src/Console/Log.es6 index c24a4c7..f8be254 100644 --- a/src/Console/Log.es6 +++ b/src/Console/Log.es6 @@ -77,7 +77,7 @@ export default class Log if (this._needSrc()) { - this.src = extractObj(args.length === 1 && util.isObj(args[0]) ? args[0] : args, {prototype: true}); + this.src = extractObj(args.length === 1 && util.isObj(args[0]) ? args[0] : args, {simple: false}); } let msg = '', icon; @@ -177,7 +177,7 @@ Log.showSrcInSources = false; function stringifyWrapper(obj, options = {}) { util.defaults(options, { - prototype: false, + simple: true, highlight: true, keyQuotes: false, specialVal: true, diff --git a/src/lib/stringify.es6 b/src/lib/stringify.es6 index 05ba900..08ec478 100644 --- a/src/lib/stringify.es6 +++ b/src/lib/stringify.es6 @@ -4,7 +4,7 @@ import util from './util' export default function stringify(obj, { visited = [], topObj, - prototype = false, + simple = false, keyQuotes = true, getterVal = false, highlight = false, @@ -103,7 +103,7 @@ export default function stringify(obj, { visited.push(obj); json = '['; - util.each(obj, val => parts.push(`${stringify(val, {visited, specialVal, prototype, getterVal, keyQuotes, highlight, unenumerable})}`)); + util.each(obj, val => parts.push(`${stringify(val, {visited, specialVal, simple, getterVal, keyQuotes, highlight, unenumerable})}`)); json += parts.join(', ') + ']'; } else if (isObj || isFn) { @@ -111,7 +111,7 @@ export default function stringify(obj, { names = unenumerable ? Object.getOwnPropertyNames(obj) : Object.keys(obj); proto = Object.getPrototypeOf(obj); - if (proto === Object.prototype || isFn || prototype) proto = null; + if (proto === Object.prototype || isFn || simple) proto = null; if (proto) proto = `${wrapKey('erudaProto')}: ${stringify(proto, {visited, specialVal, getterVal, topObj, keyQuotes, highlight, unenumerable})}`; names.sort(sortObjName); if (isFn) @@ -144,7 +144,7 @@ export default function stringify(obj, { return parts.push(`${key}: ${wrapStr('(...)')}`); } } - parts.push(`${key}: ${stringify(topObj[name], {visited, specialVal, getterVal, prototype, keyQuotes, highlight, unenumerable})}`); + parts.push(`${key}: ${stringify(topObj[name], {visited, specialVal, getterVal, simple, keyQuotes, highlight, unenumerable})}`); }); if (proto) parts.push(proto); json += parts.join(', ') + ' }'; @@ -183,10 +183,10 @@ export default function stringify(obj, { visited.push(obj); json = '{ '; - if (!prototype) parts.push(`${wrapKey('erudaObjAbstract')}: "${type.replace(/(\[object )|]/g, '')}"`); + if (!simple) parts.push(`${wrapKey('erudaObjAbstract')}: "${type.replace(/(\[object )|]/g, '')}"`); names = unenumerable ? Object.getOwnPropertyNames(obj) : Object.keys(obj); proto = Object.getPrototypeOf(obj); - if (proto === Object.prototype || prototype) proto = null; + if (proto === Object.prototype || simple) proto = null; if (proto) { try @@ -210,7 +210,7 @@ export default function stringify(obj, { return parts.push(`${key}: ${wrapStr('(...)')}`); } } - parts.push(`${key}: ${stringify(topObj[name], {visited, specialVal, getterVal, prototype, keyQuotes, highlight, unenumerable})}`); + parts.push(`${key}: ${stringify(topObj[name], {visited, specialVal, getterVal, simple, keyQuotes, highlight, unenumerable})}`); }); if (proto) parts.push(proto); json += parts.join(',\n') + ' }';