console.log
should not be a constructor · Issue #25987 · nodejs/node (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Description
- Version: v11.9.0
- Platform: Darwin Laurents-MacBook-Pro-2.local 17.7.0 Darwin Kernel Version 17.7.0: Fri Nov 2 20:43:16 PDT 2018; root:xnu-4570.71.17~1/RELEASE_X86_64 x86_64
- Subsystem:
In node, console.log
behaves like a constructor without a prototype
field. Other runtimes throw a proper type error in both lines below:
$ node
> new console.log();
consoleCall {}
> Reflect.construct(Boolean, [], console.log);
[Boolean: false]
Much love,
Laurent