nodejs / node-chakracore

Node.js on ChakraCore :sparkles::turtle::rocket::sparkles:
Other
1.92k stars 342 forks source link

this === global yields false in node-chakracore #170

Open alexlamsl opened 7 years ago

alexlamsl commented 7 years ago

this === global gives true on Node.js (tested 7.4.0) where as node-chakracore gives false (tested 7.0.0-pre9 and v8.0.0-nightly201701238e66382a18)

This breaks vows as it decides what to pass on as context object.

alexlamsl commented 7 years ago

Reproducible on 8.4.0

MSLaguana commented 7 years ago

Looks like the issue is that this === global.__proto__ rather than this === global.

alexlamsl commented 7 years ago

The workaround I tried with vows was this.global === global, but your version should also work.

(This won't address the disparity between node and node-chakracore, however.)

alexlamsl commented 6 years ago

Still an issue as of v10.1.0

$ nvs use node
PATH = node\10.2.1\x64

$ echo 'console.log(function(){return this === global}())' | node
true
$ nvs use chakracore
PATH = chakracore\10.1.0\x64

$ echo 'console.log(function(){return this === global}())' | node
false
alexlamsl commented 6 years ago

Still an issue as of v10.6.0