-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Closed
Labels
utilIssues and PRs related to the built-in util module.Issues and PRs related to the built-in util module.v8 engineIssues and PRs related to the V8 dependency.Issues and PRs related to the V8 dependency.
Description
- Version: v13.9.0
- Platform: Windows 10 v1903 build 18362.657 64‑bit
- Subsystem:
util
What steps will reproduce the bug?
Run node --allow-natives-syntax -p 'util.inspect(%GetUndetectable())'
What is the expected behavior?
> node --allow-natives-syntax -p 'util.inspect(%GetUndetectable())'
[Function (anonymous)]
What do you see instead?
> node --allow-natives-syntax -p 'util.inspect(%GetUndetectable())'
undefined
Additional information
This is because the type check in util.inspect
doesn’t account for objects with the [[IsHTMLDDA]]
internal slot:
node/lib/internal/util/inspect.js
Lines 681 to 688 in cdac185
function formatValue(ctx, value, recurseTimes, typedArray) { | |
// Primitive types cannot have properties. | |
if (typeof value !== 'object' && typeof value !== 'function') { | |
return formatPrimitive(ctx.stylize, value, ctx); | |
} | |
if (value === null) { | |
return ctx.stylize('null', 'null'); | |
} |
Metadata
Metadata
Assignees
Labels
utilIssues and PRs related to the built-in util module.Issues and PRs related to the built-in util module.v8 engineIssues and PRs related to the V8 dependency.Issues and PRs related to the V8 dependency.