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: show External values explicitly in inspect · ppaugh/node@3cc3e09

File tree

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

‎lib/util.js‎

Copy file name to clipboardExpand all lines: lib/util.js
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,9 @@ function formatValue(ctx, value, recurseTimes) {
466466
return `${constructor.name}` +
467467
` { byteLength: ${formatNumber(ctx, value.byteLength)} }`;
468468
}
469+
if (binding.isExternal(value)) {
470+
return ctx.stylize('[External]', 'special');
471+
}
469472
}
470473

471474
var base = '';
Collapse file

‎src/node_util.cc‎

Copy file name to clipboardExpand all lines: src/node_util.cc
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ using v8::Value;
2222
V(isArrayBuffer, IsArrayBuffer) \
2323
V(isDataView, IsDataView) \
2424
V(isDate, IsDate) \
25+
V(isExternal, IsExternal) \
2526
V(isMap, IsMap) \
2627
V(isMapIterator, IsMapIterator) \
2728
V(isPromise, IsPromise) \
Collapse file

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

Copy file name to clipboardExpand all lines: test/parallel/test-util-inspect.js
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ assert.strictEqual(util.inspect(Object.assign(new String('hello'),
8282
{ [Symbol('foo')]: 123 }), { showHidden: true }),
8383
'{ [String: \'hello\'] [length]: 5, [Symbol(foo)]: 123 }');
8484

85+
assert.strictEqual(util.inspect(process.stdin._handle._externalStream),
86+
'[External]');
87+
8588
{
8689
const regexp = /regexp/;
8790
regexp.aprop = 42;

0 commit comments

Comments
0 (0)
You are visitor 01402792 — 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.