| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 9fb10dc commit b5c5bd1
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1739,6 +1739,8 @@ function formatProperty(ctx, value, recurseTimes, key, type, desc, | |||
| 1739 | 1739 | if (typeof key === 'symbol') { | |
| 1740 | 1740 | const tmp = key.toString().replace(strEscapeSequencesReplacer, escapeFn); | |
| 1741 | 1741 | name = `[${ctx.stylize(tmp, 'symbol')}]`; | |
| 1742 | + } else if (key === '__proto__') { | ||
| 1743 | + name = "['__proto__']"; | ||
| 1742 | 1744 | } else if (desc.enumerable === false) { | |
| 1743 | 1745 | name = `[${key.replace(strEscapeSequencesReplacer, escapeFn)}]`; | |
| 1744 | 1746 | } else if (keyStrRegExp.test(key)) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3094,3 +3094,10 @@ assert.strictEqual( | |||
| 3094 | 3094 | ']' | |
| 3095 | 3095 | ); | |
| 3096 | 3096 | } | |
| 3097 | + | ||
| 3098 | + { | ||
| 3099 | + assert.strictEqual( | ||
| 3100 | + util.inspect({ ['__proto__']: { a: 1 } }), | ||
| 3101 | + "{ ['__proto__']: { a: 1 } }" | ||
| 3102 | + ); | ||
| 3103 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments