ljharb / es-abstract

ECMAScript spec abstract operations.
MIT License
114 stars 30 forks source link

Seeing errors with strict mode #64

Closed suriyasundar92 closed 5 years ago

suriyasundar92 commented 5 years ago

https://github.com/ljharb/es-abstract/commit/f721f34e19025767851822c9328ca17270b05578#diff-1135727984677bc9cd2ff2cab6a50776R9

We are seeing failures in out builds after the previous change. This happens when we load our test files in a PhantomJs browser.

PhantomJS 2.1.1 (Linux 0.0.0) ERROR
15:12:28   {
15:12:28     "message": "ReferenceError: Strict mode forbids implicit creation of global property 'inferred'\nat undefined:9:0",
15:12:28     "str": "ReferenceError: Strict mode forbids implicit creation of global property 'inferred'\nat undefined:9:0"
15:12:28   }
15:12:28 
ljharb commented 5 years ago

I’m confused. Strict mode is only opted into by code with the pragma. Are you using some kind of setting for phantom called “strict” that isn’t actually strict mode?

ljharb commented 5 years ago

In particular, all of those files are separate modules, so they should all be in sloppy mode absent the pragma, and all should be executing in their own non-global scope.

ljharb commented 5 years ago

Closing, pending more repro info.