-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Closed
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.utilIssues and PRs related to the built-in util module.Issues and PRs related to the built-in util module.
Description
Looks like a Node.js bug. Logging an object should never crash. The same works in the browser:
function X () {}
X.prototype = null;
x = {};
x.constructor = X;
console.log(x);
Node.js:
Uncaught TypeError: Function has non-object prototype 'null' in instanceof check
at Function.[Symbol.hasInstance] (<anonymous>)
at getConstructorName (internal/util/inspect.js:535:13)
at formatRaw (internal/util/inspect.js:803:23)
at formatValue (internal/util/inspect.js:793:10)
at inspect (internal/util/inspect.js:326:10)
at formatWithOptionsInternal (internal/util/inspect.js:1994:40)
at formatWithOptions (internal/util/inspect.js:1878:10)
at Object.value (internal/console/constructor.js:306:14)
at Object.log (internal/console/constructor.js:341:61)
Browser:
{constructor: ƒ}
node Verison: v14.14.0
baylesa-dev, ExE-Boss, sokra, samal-rasmussen, zaandr and 14 moreExE-Boss, Trystan-SA, jasonwilliams, marxangels, bl-ue and 1 more
Metadata
Metadata
Assignees
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.utilIssues and PRs related to the built-in util module.Issues and PRs related to the built-in util module.