polyfill icon indicating copy to clipboard operation
polyfill copied to clipboard

Functions unification and fix babel transpile

Open AlikDex opened this issue 5 years ago • 2 comments

AlikDex avatar Jul 11 '19 04:07 AlikDex

Hmmm... the use of self is fine in browsers (which is what I mostly care about) but in Node environments it won't be present and some folks do use it there and complain...

inexorabletash avatar Dec 10 '19 03:12 inexorabletash

If you wanna pass a global root here's the right argument :

(function () {
  try {
    return Function('return this')() || (42, eval)('this');
  } catch (e) {
    return self;
  }
})()

Mouvedia avatar Dec 10 '19 09:12 Mouvedia