-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Closed
Closed
Copy link
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
- Version: v8.9.4
- Platform: Linux stola-ThinkPad 3.16.0-38-generic io.js on The Changelog!Β #52~14.04.1-Ubuntu SMP Fri May 8 09:43:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
- Subsystem: util
util.inspect(Object.setPrototypeOf(function() {}, null)) results in
TypeError: Cannot read property 'name' of null
at formatValue (util.js:523:35)
at Object.inspect (util.js:324:10)
Note that this is the code that is used by REPL to print the result of Object.setPrototypeOf(function() {}, null) expression.
This TypeError is confusing and unnecessary. It comes from constructor.name in util.js:523. Few lines above (line 457) there is const ctorName = ... code that attempts to avoid problems like this, i.e., it would be sufficient to use ctorName instead of constructor.name on line 523.
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.