stefanpenner / es6-promise

A polyfill for ES6-style Promises

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Auto polyfill overwrites native promise in Edge

gzhelev opened this issue · comments

I am using the auto polyfill in a typescript project and came across that the polyfill function overwrites the native implementation of Edge`s Promise.

The problem comes from the [object Promise] condition. Seems in Edge the result in promiseToString is [object Object]

 var P = local.Promise;

    if (P) {
      var promiseToString = null;
      try {
        promiseToString = Object.prototype.toString.call(P.resolve());
      } catch (e) {
        // silently ignored
      }

      if (promiseToString === '[object Promise]' && !P.cast) {
        return;
      }
    }

Is this intentionally because I have not came accors a problem with Edge`s promises.

The problem comes from the [object Promise] condition. Seems in Edge the result in promiseToString is [object Object]

Seems like edge needs to fix ^