@@ -5478,8 +5478,8 @@ Worker.prototype.then = function then(onFulfilled, onRejected) {
54785478 onRejected = onRejected . bind ( self ) ;
54795479 }
54805480
5481- // Cast self into a Promise to avoid es6-promise recursively defining `then`.
5482- var selfPromise = '_state' in self ? Worker . convert ( _extends ( { } , self ) , Promise . prototype ) : self ;
5481+ // Cast self into a Promise to avoid polyfills recursively defining `then`.
5482+ var selfPromise = Promise . toString ( ) . indexOf ( '[native code]' ) === - 1 ? Worker . convert ( _extends ( { } , self ) , Promise . prototype ) : self ;
54835483
54845484 // Update progress while queuing, calling, and resolving `then`.
54855485 self . updateProgress ( null , null , 1 , [ onFulfilled ] ) ;
@@ -5507,8 +5507,8 @@ Worker.prototype.thenCore = function thenCore(onFulfilled, onRejected) {
55075507 onRejected = onRejected . bind ( self ) ;
55085508 }
55095509
5510- // Cast self into a Promise to avoid es6-promise recursively defining `then`.
5511- var selfPromise = '_state' in self ? Worker . convert ( _extends ( { } , self ) , Promise . prototype ) : self ;
5510+ // Cast self into a Promise to avoid polyfills recursively defining `then`.
5511+ var selfPromise = Promise . toString ( ) . indexOf ( '[native code]' ) === - 1 ? Worker . convert ( _extends ( { } , self ) , Promise . prototype ) : self ;
55125512
55135513 // Return the promise, after casting it into a Worker and preserving props.
55145514 var returnVal = Promise . prototype . then . call ( selfPromise , onFulfilled , onRejected ) ;
0 commit comments