GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — util: inspect __proto__ key as written in object literal · nodejs/node@80af610

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal/util
    • inspect.js
  • test/parallel
    • test-util-inspect.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/util/inspect.js‎

Copy file name to clipboardExpand all lines: lib/internal/util/inspect.js
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1718,6 +1718,8 @@ function formatProperty(ctx, value, recurseTimes, key, type, desc,
17181718
strEscapeSequencesReplacer, escapeFn
17191719
);
17201720
name = `[${ctx.stylize(tmp, 'symbol')}]`;
1721+
} else if (key === '__proto__') {
1722+
name = "['__proto__']";
17211723
} else if (desc.enumerable === false) {
17221724
const tmp = StringPrototypeReplace(key,
17231725
strEscapeSequencesReplacer, escapeFn);
Collapse file

‎test/parallel/test-util-inspect.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-util-inspect.js
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3095,3 +3095,10 @@ assert.strictEqual(
30953095
']'
30963096
);
30973097
}
3098+
3099+
{
3100+
assert.strictEqual(
3101+
util.inspect({ ['__proto__']: { a: 1 } }),
3102+
"{ ['__proto__']: { a: 1 } }"
3103+
);
3104+
}

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.