File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -138,6 +138,9 @@ function testRequestAnimationFrame(){
138138}
139139
140140function testRequestIdleCallback ( ) {
141+ cancelIdleCallback ( null ) ;
142+ cancelIdleCallback ( undefined ) ;
143+
141144 let handle = requestIdleCallback ( deadline => {
142145 const didTimeout : boolean = deadline . didTimeout ;
143146 const remaining : number = deadline . timeRemaining ( ) ;
@@ -151,9 +154,8 @@ function testRequestIdleCallback() {
151154 // @ts -expect-error
152155 requestIdleCallback ( noop , { timeout : 'wrong-type' } ) ;
153156
154- // handle is opaque: object on New Architecture, number on legacy
155157 // @ts -expect-error
156- const handleIsNotNumber : number = requestIdleCallback ( noop ) ;
158+ cancelIdleCallback ( 'wrong-type' ) ;
157159}
158160
159161const fetchCopy : WindowOrWorkerGlobalScope [ 'fetch' ] = fetch ;
Original file line number Diff line number Diff line change @@ -125,15 +125,14 @@ declare global {
125125 function cancelAnimationFrame ( handle : number | null | undefined ) : void ;
126126 function requestAnimationFrame ( callback : ( time : number ) => void ) : number ;
127127
128- type IdleCallbackID = unknown ;
129128 function requestIdleCallback (
130129 callback : ( deadline : {
131130 didTimeout : boolean ;
132131 timeRemaining : ( ) => number ;
133132 } ) => void ,
134133 options ?: { timeout : number } ,
135- ) : IdleCallbackID ;
136- function cancelIdleCallback ( handle : IdleCallbackID ) : void ;
134+ ) : number ;
135+ function cancelIdleCallback ( handle : number | null | undefined ) : void ;
137136
138137 function fetchBundle (
139138 bundleId : number ,
You can’t perform that action at this time.
0 commit comments