stefanpenner / es6-promise

A polyfill for ES6-style Promises
MIT License
7.3k stars 593 forks source link

The automatic polyfill fails when both 'window' and 'global' exist. #340

Open RudeySH opened 5 years ago

RudeySH commented 5 years ago

I just had some trouble with the polyfill. I'm building a browser app which has a global variable named global. This caused the polyfill to add the Promise object to my global object, instead of adding it to window. The opposite could also happen: building a Node app that has a variable named window.

Not sure if this should be fixed, though. I reckon it was probably a bad idea by me to have a global variable anyway. I renamed it to something else so I can continue to use this polyfill.