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) {
416416 if ( onFulfilled ) { onFulfilled = onFulfilled . bind ( self ) ; }
417417 if ( onRejected ) { onRejected = onRejected . bind ( self ) ; }
418418
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 ) ?
421421 Worker . convert ( Object . assign ( { } , self ) , Promise . prototype ) : self ;
422422
423423 // Update progress while queuing, calling, and resolving `then`.
@@ -442,8 +442,8 @@ Worker.prototype.thenCore = function thenCore(onFulfilled, onRejected) {
442442 if ( onFulfilled ) { onFulfilled = onFulfilled . bind ( self ) ; }
443443 if ( onRejected ) { onRejected = onRejected . bind ( self ) ; }
444444
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 ) ?
447447 Worker . convert ( Object . assign ( { } , self ) , Promise . prototype ) : self ;
448448
449449 // Return the promise, after casting it into a Worker and preserving props.
You can’t perform that action at this time.
0 commit comments