11'use strict' ;
22
33const {
4+ FunctionPrototypeBind,
45 Promise,
56 PromisePrototypeFinally,
67 PromiseReject,
@@ -72,8 +73,9 @@ function setTimeout(after, value, options = {}) {
7273 if ( ! ref ) timeout . unref ( ) ;
7374 insert ( timeout , timeout . _idleTimeout ) ;
7475 if ( signal ) {
75- // eslint-disable-next-line no-undef
76- oncancel = cancelListenerHandler . bind ( timeout , clearTimeout , reject ) ;
76+ oncancel = FunctionPrototypeBind ( cancelListenerHandler ,
77+ // eslint-disable-next-line no-undef
78+ timeout , clearTimeout , reject ) ;
7779 signal . addEventListener ( 'abort' , oncancel ) ;
7880 }
7981 } ) ;
@@ -121,8 +123,9 @@ function setImmediate(value, options = {}) {
121123 const immediate = new Immediate ( resolve , [ value ] ) ;
122124 if ( ! ref ) immediate . unref ( ) ;
123125 if ( signal ) {
124- // eslint-disable-next-line no-undef
125- oncancel = cancelListenerHandler . bind ( immediate , clearImmediate , reject ) ;
126+ oncancel = FunctionPrototypeBind ( cancelListenerHandler ,
127+ // eslint-disable-next-line no-undef
128+ immediate , clearImmediate , reject ) ;
126129 signal . addEventListener ( 'abort' , oncancel ) ;
127130 }
128131 } ) ;
0 commit comments