Skip to content

Commit 613aba1

Browse files
committed
Modify Angular fix to not break in Firefox
1 parent 7196259 commit 613aba1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/worker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,8 +428,8 @@ Worker.prototype.thenCore = function thenCore(onFulfilled, onRejected, thenBase)
428428
if (onRejected) { onRejected = onRejected.bind(self); }
429429

430430
// Cast self into a Promise to avoid polyfills recursively defining `then`.
431-
var selfPromise = (Promise.toString() !== 'function Promise() { [native code] }') ?
432-
Worker.convert(Object.assign({}, self), Promise.prototype) : self;
431+
var isNative = Promise.toString().indexOf('[native code]') !== -1 && Promise.name === 'Promise';
432+
var selfPromise = isNative ? self : Worker.convert(Object.assign({}, self), Promise.prototype);
433433

434434
// Return the promise, after casting it into a Worker and preserving props.
435435
var returnVal = thenBase.call(selfPromise, onFulfilled, onRejected);

0 commit comments

Comments
 (0)