File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -416,8 +416,8 @@ Worker.prototype.then = function then(onFulfilled, onRejected) {
416
416
if ( onFulfilled ) { onFulfilled = onFulfilled . bind ( self ) ; }
417
417
if ( onRejected ) { onRejected = onRejected . bind ( self ) ; }
418
418
419
- // Cast self into a Promise to avoid es6-promise recursively defining `then`.
420
- var selfPromise = ( '_state' in self ) ?
419
+ // Cast self into a Promise to avoid polyfills recursively defining `then`.
420
+ var selfPromise = ( Promise . toString ( ) . indexOf ( '[native code]' ) === - 1 ) ?
421
421
Worker . convert ( Object . assign ( { } , self ) , Promise . prototype ) : self ;
422
422
423
423
// Update progress while queuing, calling, and resolving `then`.
@@ -442,8 +442,8 @@ Worker.prototype.thenCore = function thenCore(onFulfilled, onRejected) {
442
442
if ( onFulfilled ) { onFulfilled = onFulfilled . bind ( self ) ; }
443
443
if ( onRejected ) { onRejected = onRejected . bind ( self ) ; }
444
444
445
- // Cast self into a Promise to avoid es6-promise recursively defining `then`.
446
- var selfPromise = ( '_state' in self ) ?
445
+ // Cast self into a Promise to avoid polyfills recursively defining `then`.
446
+ var selfPromise = ( Promise . toString ( ) . indexOf ( '[native code]' ) === - 1 ) ?
447
447
Worker . convert ( Object . assign ( { } , self ) , Promise . prototype ) : self ;
448
448
449
449
// Return the promise, after casting it into a Worker and preserving props.
You can’t perform that action at this time.
0 commit comments