I guess any polyfill with self
reference instead of window
will do (for example promise-polyfill/polyfill.js at master 路 taylorhakes/promise-polyfill 路 GitHub) .
Adding this kind of global object detection method (self->window->global) to the PromisePolyfill.Apply method (in BJS) will allow you to use this polyfill in webworkers as well (not tested, just a thought )
1 Like