scheduler
Advanced tools
Comparing version 0.24.0-canary-7118f5dd7-20230705 to 0.24.0-canary-720de7f81a-20241220
@@ -67,5 +67,6 @@ /** | ||
var controller = new TaskController(); | ||
var controller = new TaskController({ | ||
priority: postTaskPriority | ||
}); | ||
var postTaskOptions = { | ||
priority: postTaskPriority, | ||
delay: typeof options === 'object' && options !== null ? options.delay : 0, | ||
@@ -92,5 +93,6 @@ signal: controller.signal | ||
var continuation = result; | ||
var continuationController = new TaskController(); | ||
var continuationController = new TaskController({ | ||
priority: postTaskPriority | ||
}); | ||
var continuationOptions = { | ||
priority: postTaskPriority, | ||
signal: continuationController.signal | ||
@@ -101,3 +103,9 @@ }; // Update the original callback node's controller, since even though we're | ||
node._controller = continuationController; | ||
scheduler.postTask(runTask.bind(null, priorityLevel, postTaskPriority, node, continuation), continuationOptions).catch(handleAbortError); | ||
var nextTask = runTask.bind(null, priorityLevel, postTaskPriority, node, continuation); | ||
if (scheduler.yield !== undefined) { | ||
scheduler.yield(continuationOptions).then(nextTask).catch(handleAbortError); | ||
} else { | ||
scheduler.postTask(nextTask, continuationOptions).catch(handleAbortError); | ||
} | ||
} | ||
@@ -104,0 +112,0 @@ } catch (error) { |
@@ -10,6 +10,6 @@ /** | ||
*/ | ||
'use strict';var a=window.performance,g=window.setTimeout,h=global.scheduler,k=a.now.bind(a),l=0,m=3;function p(c,d,b,f){l=k()+5;try{m=c;var e=f(!1);if("function"===typeof e){var n=new TaskController,r={priority:d,signal:n.signal};b._controller=n;h.postTask(p.bind(null,c,d,b,e),r).catch(q)}}catch(t){g(function(){throw t;})}finally{m=3}}function q(){}exports.unstable_IdlePriority=5;exports.unstable_ImmediatePriority=1;exports.unstable_LowPriority=4;exports.unstable_NormalPriority=3; | ||
exports.unstable_Profiling=null;exports.unstable_UserBlockingPriority=2;exports.unstable_cancelCallback=function(c){c._controller.abort()};exports.unstable_continueExecution=function(){};exports.unstable_forceFrameRate=function(){};exports.unstable_getCurrentPriorityLevel=function(){return m};exports.unstable_getFirstCallbackNode=function(){return null};exports.unstable_next=function(c){switch(m){case 1:case 2:case 3:var d=3;break;default:d=m}var b=m;m=d;try{return c()}finally{m=b}}; | ||
exports.unstable_now=k;exports.unstable_pauseExecution=function(){};exports.unstable_requestPaint=function(){};exports.unstable_runWithPriority=function(c,d){var b=m;m=c;try{return d()}finally{m=b}}; | ||
exports.unstable_scheduleCallback=function(c,d,b){switch(c){case 1:case 2:var f="user-blocking";break;case 4:case 3:f="user-visible";break;case 5:f="background";break;default:f="user-visible"}var e=new TaskController;b={priority:f,delay:"object"===typeof b&&null!==b?b.delay:0,signal:e.signal};e={_controller:e};h.postTask(p.bind(null,c,f,e,d),b).catch(q);return e};exports.unstable_shouldYield=function(){return k()>=l}; | ||
'use strict';var a=window.performance,g=window.setTimeout,h=global.scheduler,k=a.now.bind(a),l=0,m=3;function n(c,d,b,f){l=k()+5;try{m=c;var e=f(!1);if("function"===typeof e){var p=new TaskController({priority:d}),q={signal:p.signal};b._controller=p;var r=n.bind(null,c,d,b,e);void 0!==h.yield?h.yield(q).then(r).catch(t):h.postTask(r,q).catch(t)}}catch(u){g(function(){throw u;})}finally{m=3}}function t(){}exports.unstable_IdlePriority=5;exports.unstable_ImmediatePriority=1; | ||
exports.unstable_LowPriority=4;exports.unstable_NormalPriority=3;exports.unstable_Profiling=null;exports.unstable_UserBlockingPriority=2;exports.unstable_cancelCallback=function(c){c._controller.abort()};exports.unstable_continueExecution=function(){};exports.unstable_forceFrameRate=function(){};exports.unstable_getCurrentPriorityLevel=function(){return m};exports.unstable_getFirstCallbackNode=function(){return null}; | ||
exports.unstable_next=function(c){switch(m){case 1:case 2:case 3:var d=3;break;default:d=m}var b=m;m=d;try{return c()}finally{m=b}};exports.unstable_now=k;exports.unstable_pauseExecution=function(){};exports.unstable_requestPaint=function(){};exports.unstable_runWithPriority=function(c,d){var b=m;m=c;try{return d()}finally{m=b}}; | ||
exports.unstable_scheduleCallback=function(c,d,b){switch(c){case 1:case 2:var f="user-blocking";break;case 4:case 3:f="user-visible";break;case 5:f="background";break;default:f="user-visible"}var e=new TaskController({priority:f});b={delay:"object"===typeof b&&null!==b?b.delay:0,signal:e.signal};e={_controller:e};h.postTask(n.bind(null,c,f,e,d),b).catch(t);return e};exports.unstable_shouldYield=function(){return k()>=l}; | ||
exports.unstable_wrapCallback=function(c){var d=m;return function(){var b=m;m=d;try{return c()}finally{m=b}}}; |
@@ -202,3 +202,3 @@ /** | ||
isHostCallbackScheduled = true; | ||
requestHostCallback(flushWork); | ||
requestHostCallback(); | ||
} else { | ||
@@ -214,3 +214,3 @@ var firstTimer = peek(timerQueue); | ||
function flushWork(hasTimeRemaining, initialTime) { | ||
function flushWork(initialTime) { | ||
@@ -232,3 +232,3 @@ | ||
// No catch in prod code path. | ||
return workLoop(hasTimeRemaining, initialTime); | ||
return workLoop(initialTime); | ||
} | ||
@@ -242,3 +242,3 @@ } finally { | ||
function workLoop(hasTimeRemaining, initialTime) { | ||
function workLoop(initialTime) { | ||
var currentTime = initialTime; | ||
@@ -249,3 +249,3 @@ advanceTimers(currentTime); | ||
while (currentTask !== null && !(enableSchedulerDebugging )) { | ||
if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) { | ||
if (currentTask.expirationTime > currentTime && shouldYieldToHost()) { | ||
// This currentTask hasn't expired, and we've reached the deadline. | ||
@@ -449,3 +449,3 @@ break; | ||
isHostCallbackScheduled = true; | ||
requestHostCallback(flushWork); | ||
requestHostCallback(); | ||
} | ||
@@ -464,3 +464,3 @@ } | ||
isHostCallbackScheduled = true; | ||
requestHostCallback(flushWork); | ||
requestHostCallback(); | ||
} | ||
@@ -486,3 +486,2 @@ } | ||
var isMessageLoopRunning = false; | ||
var scheduledHostCallback = null; | ||
var taskTimeoutID = -1; // Scheduler periodically yields in case there is other work on the main | ||
@@ -529,13 +528,12 @@ // thread, like user events. By default, it yields multiple times per frame. | ||
var performWorkUntilDeadline = function () { | ||
if (scheduledHostCallback !== null) { | ||
if (isMessageLoopRunning) { | ||
var currentTime = exports.unstable_now(); // Keep track of the start time so we can measure how long the main thread | ||
// has been blocked. | ||
startTime = currentTime; | ||
var hasTimeRemaining = true; // If a scheduler task throws, exit the current browser task so the | ||
startTime = currentTime; // If a scheduler task throws, exit the current browser task so the | ||
// error can be observed. | ||
// | ||
// Intentionally not using a try-catch, since that makes some debugging | ||
// techniques harder. Instead, if `scheduledHostCallback` errors, then | ||
// `hasMoreWork` will remain true, and we'll continue the work loop. | ||
// techniques harder. Instead, if `flushWork` errors, then `hasMoreWork` will | ||
// remain true, and we'll continue the work loop. | ||
@@ -545,4 +543,3 @@ var hasMoreWork = true; | ||
try { | ||
// $FlowFixMe[not-a-function] found when upgrading Flow | ||
hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime); | ||
hasMoreWork = flushWork(currentTime); | ||
} finally { | ||
@@ -555,7 +552,4 @@ if (hasMoreWork) { | ||
isMessageLoopRunning = false; | ||
scheduledHostCallback = null; | ||
} | ||
} | ||
} else { | ||
isMessageLoopRunning = false; | ||
} // Yielding to the browser will give it a chance to paint, so we can | ||
@@ -599,5 +593,3 @@ }; | ||
function requestHostCallback(callback) { | ||
scheduledHostCallback = callback; | ||
function requestHostCallback() { | ||
if (!isMessageLoopRunning) { | ||
@@ -604,0 +596,0 @@ isMessageLoopRunning = true; |
@@ -193,3 +193,3 @@ /** | ||
isHostCallbackScheduled = true; | ||
requestHostCallback(flushWork); | ||
requestHostCallback(); | ||
} else { | ||
@@ -205,3 +205,3 @@ var firstTimer = peek(timerQueue); | ||
function flushWork(hasTimeRemaining, initialTime) { | ||
function flushWork(initialTime) { | ||
@@ -223,3 +223,3 @@ | ||
// No catch in prod code path. | ||
return workLoop(hasTimeRemaining, initialTime); | ||
return workLoop(initialTime); | ||
} | ||
@@ -233,3 +233,3 @@ } finally { | ||
function workLoop(hasTimeRemaining, initialTime) { | ||
function workLoop(initialTime) { | ||
var currentTime = initialTime; | ||
@@ -240,3 +240,3 @@ advanceTimers(currentTime); | ||
while (currentTask !== null && !(enableSchedulerDebugging )) { | ||
if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) { | ||
if (currentTask.expirationTime > currentTime && shouldYieldToHost()) { | ||
// This currentTask hasn't expired, and we've reached the deadline. | ||
@@ -373,3 +373,3 @@ break; | ||
isHostCallbackScheduled = true; | ||
requestHostCallback(flushWork); | ||
requestHostCallback(); | ||
} | ||
@@ -394,3 +394,2 @@ } | ||
var isMessageLoopRunning = false; | ||
var scheduledHostCallback = null; | ||
var taskTimeoutID = -1; // Scheduler periodically yields in case there is other work on the main | ||
@@ -422,13 +421,12 @@ // thread, like user events. By default, it yields multiple times per frame. | ||
var performWorkUntilDeadline = function () { | ||
if (scheduledHostCallback !== null) { | ||
if (isMessageLoopRunning) { | ||
var currentTime = getCurrentTime(); // Keep track of the start time so we can measure how long the main thread | ||
// has been blocked. | ||
startTime = currentTime; | ||
var hasTimeRemaining = true; // If a scheduler task throws, exit the current browser task so the | ||
startTime = currentTime; // If a scheduler task throws, exit the current browser task so the | ||
// error can be observed. | ||
// | ||
// Intentionally not using a try-catch, since that makes some debugging | ||
// techniques harder. Instead, if `scheduledHostCallback` errors, then | ||
// `hasMoreWork` will remain true, and we'll continue the work loop. | ||
// techniques harder. Instead, if `flushWork` errors, then `hasMoreWork` will | ||
// remain true, and we'll continue the work loop. | ||
@@ -438,4 +436,3 @@ var hasMoreWork = true; | ||
try { | ||
// $FlowFixMe[not-a-function] found when upgrading Flow | ||
hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime); | ||
hasMoreWork = flushWork(currentTime); | ||
} finally { | ||
@@ -448,7 +445,4 @@ if (hasMoreWork) { | ||
isMessageLoopRunning = false; | ||
scheduledHostCallback = null; | ||
} | ||
} | ||
} else { | ||
isMessageLoopRunning = false; | ||
} // Yielding to the browser will give it a chance to paint, so we can | ||
@@ -492,5 +486,3 @@ }; | ||
function requestHostCallback(callback) { | ||
scheduledHostCallback = callback; | ||
function requestHostCallback() { | ||
if (!isMessageLoopRunning) { | ||
@@ -497,0 +489,0 @@ isMessageLoopRunning = true; |
@@ -10,11 +10,12 @@ /** | ||
*/ | ||
'use strict';function f(a,b){var c=a.length;a.push(b);a:for(;0<c;){var d=c-1>>>1,e=a[d];if(0<g(e,b))a[d]=b,a[c]=e,c=d;else break a}}function h(a){return 0===a.length?null:a[0]}function k(a){if(0===a.length)return null;var b=a[0],c=a.pop();if(c!==b){a[0]=c;a:for(var d=0,e=a.length,t=e>>>1;d<t;){var m=2*(d+1)-1,E=a[m],n=m+1,A=a[n];if(0>g(E,c))n<e&&0>g(A,E)?(a[d]=A,a[n]=c,d=n):(a[d]=E,a[m]=c,d=m);else if(n<e&&0>g(A,c))a[d]=A,a[n]=c,d=n;else break a}}return b} | ||
function g(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}var l;if("object"===typeof performance&&"function"===typeof performance.now){var p=performance;l=function(){return p.now()}}else{var q=Date,r=q.now();l=function(){return q.now()-r}}var u=[],v=[],w=1,x=null,y=3,z=!1,B=!1,C=!1,D="function"===typeof setTimeout?setTimeout:null,F="function"===typeof clearTimeout?clearTimeout:null,G="undefined"!==typeof setImmediate?setImmediate:null; | ||
"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending?navigator.scheduling.isInputPending.bind(navigator.scheduling):null;function H(a){for(var b=h(v);null!==b;){if(null===b.callback)k(v);else if(b.startTime<=a)k(v),b.sortIndex=b.expirationTime,f(u,b);else break;b=h(v)}}function I(a){C=!1;H(a);if(!B)if(null!==h(u))B=!0,J=K,L||(L=!0,M());else{var b=h(v);null!==b&&N(I,b.startTime-a)}} | ||
function K(a,b){B=!1;C&&(C=!1,F(O),O=-1);z=!0;var c=y;try{a:{H(b);for(x=h(u);null!==x&&(!(x.expirationTime>b)||a&&!P());){var d=x.callback;if("function"===typeof d){x.callback=null;y=x.priorityLevel;var e=d(x.expirationTime<=b);b=l();if("function"===typeof e){x.callback=e;H(b);var t=!0;break a}else x===h(u)&&k(u),H(b)}else k(u);x=h(u)}if(null!==x)t=!0;else{var m=h(v);null!==m&&N(I,m.startTime-b);t=!1}}return t}finally{x=null,y=c,z=!1}} | ||
function Q(a,b,c){var d=l();"object"===typeof c&&null!==c?(c=c.delay,c="number"===typeof c&&0<c?d+c:d):c=d;switch(a){case 1:var e=-1;break;case 2:e=250;break;case 5:e=1073741823;break;case 4:e=1E4;break;default:e=5E3}e=c+e;a={id:w++,callback:b,priorityLevel:a,startTime:c,expirationTime:e,sortIndex:-1};c>d?(a.sortIndex=c,f(v,a),null===h(u)&&a===h(v)&&(C?(F(O),O=-1):C=!0,N(I,c-d))):(a.sortIndex=e,f(u,a),B||z||(B=!0,J=K,L||(L=!0,M())));return a}function R(a){a.callback=null}function S(){return y} | ||
var L=!1,J=null,O=-1,T=-1;function P(){return 5>l()-T?!1:!0}function U(){}function V(){if(null!==J){var a=l();T=a;var b=!0;try{b=J(!0,a)}finally{b?M():(L=!1,J=null)}}else L=!1}var M;if("function"===typeof G)M=function(){G(V)};else if("undefined"!==typeof MessageChannel){var W=new MessageChannel,X=W.port2;W.port1.onmessage=V;M=function(){X.postMessage(null)}}else M=function(){D(V,0)};function N(a,b){O=D(function(){a(l())},b)} | ||
var Y="undefined"!==typeof nativeRuntimeScheduler?nativeRuntimeScheduler.unstable_UserBlockingPriority:2,aa="undefined"!==typeof nativeRuntimeScheduler?nativeRuntimeScheduler.unstable_NormalPriority:3,ba="undefined"!==typeof nativeRuntimeScheduler?nativeRuntimeScheduler.unstable_LowPriority:4,ca="undefined"!==typeof nativeRuntimeScheduler?nativeRuntimeScheduler.unstable_ImmediatePriority:1,da="undefined"!==typeof nativeRuntimeScheduler?nativeRuntimeScheduler.unstable_scheduleCallback:Q,ea="undefined"!== | ||
typeof nativeRuntimeScheduler?nativeRuntimeScheduler.unstable_cancelCallback:R,fa="undefined"!==typeof nativeRuntimeScheduler?nativeRuntimeScheduler.unstable_getCurrentPriorityLevel:S,ha="undefined"!==typeof nativeRuntimeScheduler?nativeRuntimeScheduler.unstable_shouldYield:P,ia="undefined"!==typeof nativeRuntimeScheduler?nativeRuntimeScheduler.unstable_requestPaint:U,ja="undefined"!==typeof nativeRuntimeScheduler?nativeRuntimeScheduler.unstable_now:l; | ||
function Z(){throw Error("Not implemented.");}exports.unstable_IdlePriority="undefined"!==typeof nativeRuntimeScheduler?nativeRuntimeScheduler.unstable_IdlePriority:5;exports.unstable_ImmediatePriority=ca;exports.unstable_LowPriority=ba;exports.unstable_NormalPriority=aa;exports.unstable_Profiling=null;exports.unstable_UserBlockingPriority=Y;exports.unstable_cancelCallback=ea;exports.unstable_continueExecution=Z;exports.unstable_forceFrameRate=Z;exports.unstable_getCurrentPriorityLevel=fa; | ||
exports.unstable_getFirstCallbackNode=Z;exports.unstable_next=Z;exports.unstable_now=ja;exports.unstable_pauseExecution=Z;exports.unstable_requestPaint=ia;exports.unstable_runWithPriority=Z;exports.unstable_scheduleCallback=da;exports.unstable_shouldYield=ha;exports.unstable_wrapCallback=Z; | ||
'use strict';function f(a,c){var b=a.length;a.push(c);a:for(;0<b;){var d=b-1>>>1,e=a[d];if(0<g(e,c))a[d]=c,a[b]=e,b=d;else break a}}function h(a){return 0===a.length?null:a[0]}function k(a){if(0===a.length)return null;var c=a[0],b=a.pop();if(b!==c){a[0]=b;a:for(var d=0,e=a.length,x=e>>>1;d<x;){var y=2*(d+1)-1,D=a[y],m=y+1,z=a[m];if(0>g(D,b))m<e&&0>g(z,D)?(a[d]=z,a[m]=b,d=m):(a[d]=D,a[y]=b,d=y);else if(m<e&&0>g(z,b))a[d]=z,a[m]=b,d=m;else break a}}return c} | ||
function g(a,c){var b=a.sortIndex-c.sortIndex;return 0!==b?b:a.id-c.id}var l;if("object"===typeof performance&&"function"===typeof performance.now){var n=performance;l=function(){return n.now()}}else{var p=Date,q=p.now();l=function(){return p.now()-q}}var r=[],t=[],u=1,v=null,w=3,A=!1,B=!1,C=!1,E="function"===typeof setTimeout?setTimeout:null,F="function"===typeof clearTimeout?clearTimeout:null,G="undefined"!==typeof setImmediate?setImmediate:null; | ||
"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending?navigator.scheduling.isInputPending.bind(navigator.scheduling):null;function H(a){for(var c=h(t);null!==c;){if(null===c.callback)k(t);else if(c.startTime<=a)k(t),c.sortIndex=c.expirationTime,f(r,c);else break;c=h(t)}}function I(a){C=!1;H(a);if(!B)if(null!==h(r))B=!0,J||(J=!0,K());else{var c=h(t);null!==c&&L(I,c.startTime-a)}} | ||
function M(a,c,b){var d=l();"object"===typeof b&&null!==b?(b=b.delay,b="number"===typeof b&&0<b?d+b:d):b=d;switch(a){case 1:var e=-1;break;case 2:e=250;break;case 5:e=1073741823;break;case 4:e=1E4;break;default:e=5E3}e=b+e;a={id:u++,callback:c,priorityLevel:a,startTime:b,expirationTime:e,sortIndex:-1};b>d?(a.sortIndex=b,f(t,a),null===h(r)&&a===h(t)&&(C?(F(N),N=-1):C=!0,L(I,b-d))):(a.sortIndex=e,f(r,a),B||A||(B=!0,J||(J=!0,K())));return a}function O(a){a.callback=null}function P(){return w} | ||
var J=!1,N=-1,Q=-1;function R(){return 5>l()-Q?!1:!0}function S(){} | ||
function T(){if(J){var a=l();Q=a;var c=!0;try{a:{B=!1;C&&(C=!1,F(N),N=-1);A=!0;var b=w;try{b:{H(a);for(v=h(r);null!==v&&!(v.expirationTime>a&&R());){var d=v.callback;if("function"===typeof d){v.callback=null;w=v.priorityLevel;var e=d(v.expirationTime<=a);a=l();if("function"===typeof e){v.callback=e;H(a);c=!0;break b}v===h(r)&&k(r);H(a)}else k(r);v=h(r)}if(null!==v)c=!0;else{var x=h(t);null!==x&&L(I,x.startTime-a);c=!1}}break a}finally{v=null,w=b,A=!1}c=void 0}}finally{c?K():J=!1}}}var K; | ||
if("function"===typeof G)K=function(){G(T)};else if("undefined"!==typeof MessageChannel){var U=new MessageChannel,V=U.port2;U.port1.onmessage=T;K=function(){V.postMessage(null)}}else K=function(){E(T,0)};function L(a,c){N=E(function(){a(l())},c)} | ||
var W="undefined"!==typeof nativeRuntimeScheduler?nativeRuntimeScheduler.unstable_UserBlockingPriority:2,X="undefined"!==typeof nativeRuntimeScheduler?nativeRuntimeScheduler.unstable_NormalPriority:3,Y="undefined"!==typeof nativeRuntimeScheduler?nativeRuntimeScheduler.unstable_LowPriority:4,aa="undefined"!==typeof nativeRuntimeScheduler?nativeRuntimeScheduler.unstable_ImmediatePriority:1,ba="undefined"!==typeof nativeRuntimeScheduler?nativeRuntimeScheduler.unstable_scheduleCallback:M,ca="undefined"!== | ||
typeof nativeRuntimeScheduler?nativeRuntimeScheduler.unstable_cancelCallback:O,da="undefined"!==typeof nativeRuntimeScheduler?nativeRuntimeScheduler.unstable_getCurrentPriorityLevel:P,ea="undefined"!==typeof nativeRuntimeScheduler?nativeRuntimeScheduler.unstable_shouldYield:R,fa="undefined"!==typeof nativeRuntimeScheduler?nativeRuntimeScheduler.unstable_requestPaint:S,ha="undefined"!==typeof nativeRuntimeScheduler?nativeRuntimeScheduler.unstable_now:l; | ||
function Z(){throw Error("Not implemented.");}exports.unstable_IdlePriority="undefined"!==typeof nativeRuntimeScheduler?nativeRuntimeScheduler.unstable_IdlePriority:5;exports.unstable_ImmediatePriority=aa;exports.unstable_LowPriority=Y;exports.unstable_NormalPriority=X;exports.unstable_Profiling=null;exports.unstable_UserBlockingPriority=W;exports.unstable_cancelCallback=ca;exports.unstable_continueExecution=Z;exports.unstable_forceFrameRate=Z;exports.unstable_getCurrentPriorityLevel=da; | ||
exports.unstable_getFirstCallbackNode=Z;exports.unstable_next=Z;exports.unstable_now=ha;exports.unstable_pauseExecution=Z;exports.unstable_requestPaint=fa;exports.unstable_runWithPriority=Z;exports.unstable_scheduleCallback=ba;exports.unstable_shouldYield=ea;exports.unstable_wrapCallback=Z; |
@@ -10,12 +10,11 @@ /** | ||
*/ | ||
'use strict';function f(a,b){var c=a.length;a.push(b);a:for(;0<c;){var d=c-1>>>1,e=a[d];if(0<g(e,b))a[d]=b,a[c]=e,c=d;else break a}}function h(a){return 0===a.length?null:a[0]}function k(a){if(0===a.length)return null;var b=a[0],c=a.pop();if(c!==b){a[0]=c;a:for(var d=0,e=a.length,q=e>>>1;d<q;){var m=2*(d+1)-1,D=a[m],n=m+1,x=a[n];if(0>g(D,c))n<e&&0>g(x,D)?(a[d]=x,a[n]=c,d=n):(a[d]=D,a[m]=c,d=m);else if(n<e&&0>g(x,c))a[d]=x,a[n]=c,d=n;else break a}}return b} | ||
function g(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}exports.unstable_now=void 0;if("object"===typeof performance&&"function"===typeof performance.now){var l=performance;exports.unstable_now=function(){return l.now()}}else{var p=Date,r=p.now();exports.unstable_now=function(){return p.now()-r}} | ||
var t=[],u=[],v=1,w=null,y=3,z=!1,A=!1,B=!1,C="function"===typeof setTimeout?setTimeout:null,E="function"===typeof clearTimeout?clearTimeout:null,F="undefined"!==typeof setImmediate?setImmediate:null;"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending?navigator.scheduling.isInputPending.bind(navigator.scheduling):null; | ||
function G(a){for(var b=h(u);null!==b;){if(null===b.callback)k(u);else if(b.startTime<=a)k(u),b.sortIndex=b.expirationTime,f(t,b);else break;b=h(u)}}function H(a){B=!1;G(a);if(!A)if(null!==h(t))A=!0,I(J);else{var b=h(u);null!==b&&K(H,b.startTime-a)}} | ||
function J(a,b){A=!1;B&&(B=!1,E(L),L=-1);z=!0;var c=y;try{a:{G(b);for(w=h(t);null!==w&&(!(w.expirationTime>b)||a&&!M());){var d=w.callback;if("function"===typeof d){w.callback=null;y=w.priorityLevel;var e=d(w.expirationTime<=b);b=exports.unstable_now();if("function"===typeof e){w.callback=e;G(b);var q=!0;break a}else w===h(t)&&k(t),G(b)}else k(t);w=h(t)}if(null!==w)q=!0;else{var m=h(u);null!==m&&K(H,m.startTime-b);q=!1}}return q}finally{w=null,y=c,z=!1}}var N=!1,O=null,L=-1,P=5,Q=-1; | ||
function M(){return exports.unstable_now()-Q<P?!1:!0}function R(){if(null!==O){var a=exports.unstable_now();Q=a;var b=!0;try{b=O(!0,a)}finally{b?S():(N=!1,O=null)}}else N=!1}var S;if("function"===typeof F)S=function(){F(R)};else if("undefined"!==typeof MessageChannel){var T=new MessageChannel,U=T.port2;T.port1.onmessage=R;S=function(){U.postMessage(null)}}else S=function(){C(R,0)};function I(a){O=a;N||(N=!0,S())}function K(a,b){L=C(function(){a(exports.unstable_now())},b)} | ||
exports.unstable_IdlePriority=5;exports.unstable_ImmediatePriority=1;exports.unstable_LowPriority=4;exports.unstable_NormalPriority=3;exports.unstable_Profiling=null;exports.unstable_UserBlockingPriority=2;exports.unstable_cancelCallback=function(a){a.callback=null};exports.unstable_continueExecution=function(){A||z||(A=!0,I(J))}; | ||
exports.unstable_forceFrameRate=function(a){0>a||125<a?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<a?Math.floor(1E3/a):5};exports.unstable_getCurrentPriorityLevel=function(){return y};exports.unstable_getFirstCallbackNode=function(){return h(t)};exports.unstable_next=function(a){switch(y){case 1:case 2:case 3:var b=3;break;default:b=y}var c=y;y=b;try{return a()}finally{y=c}};exports.unstable_pauseExecution=function(){}; | ||
exports.unstable_requestPaint=function(){};exports.unstable_runWithPriority=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var c=y;y=a;try{return b()}finally{y=c}}; | ||
exports.unstable_scheduleCallback=function(a,b,c){var d=exports.unstable_now();"object"===typeof c&&null!==c?(c=c.delay,c="number"===typeof c&&0<c?d+c:d):c=d;switch(a){case 1:var e=-1;break;case 2:e=250;break;case 5:e=1073741823;break;case 4:e=1E4;break;default:e=5E3}e=c+e;a={id:v++,callback:b,priorityLevel:a,startTime:c,expirationTime:e,sortIndex:-1};c>d?(a.sortIndex=c,f(u,a),null===h(t)&&a===h(u)&&(B?(E(L),L=-1):B=!0,K(H,c-d))):(a.sortIndex=e,f(t,a),A||z||(A=!0,I(J)));return a}; | ||
exports.unstable_shouldYield=M;exports.unstable_wrapCallback=function(a){var b=y;return function(){var c=y;y=b;try{return a.apply(this,arguments)}finally{y=c}}}; | ||
'use strict';function f(a,c){var b=a.length;a.push(c);a:for(;0<b;){var d=b-1>>>1,e=a[d];if(0<g(e,c))a[d]=c,a[b]=e,b=d;else break a}}function h(a){return 0===a.length?null:a[0]}function k(a){if(0===a.length)return null;var c=a[0],b=a.pop();if(b!==c){a[0]=b;a:for(var d=0,e=a.length,v=e>>>1;d<v;){var w=2*(d+1)-1,C=a[w],m=w+1,x=a[m];if(0>g(C,b))m<e&&0>g(x,C)?(a[d]=x,a[m]=b,d=m):(a[d]=C,a[w]=b,d=w);else if(m<e&&0>g(x,b))a[d]=x,a[m]=b,d=m;else break a}}return c} | ||
function g(a,c){var b=a.sortIndex-c.sortIndex;return 0!==b?b:a.id-c.id}exports.unstable_now=void 0;if("object"===typeof performance&&"function"===typeof performance.now){var l=performance;exports.unstable_now=function(){return l.now()}}else{var n=Date,p=n.now();exports.unstable_now=function(){return n.now()-p}} | ||
var q=[],r=[],t=1,u=null,y=3,z=!1,A=!1,B=!1,D="function"===typeof setTimeout?setTimeout:null,E="function"===typeof clearTimeout?clearTimeout:null,F="undefined"!==typeof setImmediate?setImmediate:null;"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending?navigator.scheduling.isInputPending.bind(navigator.scheduling):null; | ||
function G(a){for(var c=h(r);null!==c;){if(null===c.callback)k(r);else if(c.startTime<=a)k(r),c.sortIndex=c.expirationTime,f(q,c);else break;c=h(r)}}function H(a){B=!1;G(a);if(!A)if(null!==h(q))A=!0,I();else{var c=h(r);null!==c&&J(H,c.startTime-a)}}var K=!1,L=-1,M=5,N=-1;function O(){return exports.unstable_now()-N<M?!1:!0} | ||
function P(){if(K){var a=exports.unstable_now();N=a;var c=!0;try{a:{A=!1;B&&(B=!1,E(L),L=-1);z=!0;var b=y;try{b:{G(a);for(u=h(q);null!==u&&!(u.expirationTime>a&&O());){var d=u.callback;if("function"===typeof d){u.callback=null;y=u.priorityLevel;var e=d(u.expirationTime<=a);a=exports.unstable_now();if("function"===typeof e){u.callback=e;G(a);c=!0;break b}u===h(q)&&k(q);G(a)}else k(q);u=h(q)}if(null!==u)c=!0;else{var v=h(r);null!==v&&J(H,v.startTime-a);c=!1}}break a}finally{u=null,y=b,z=!1}c=void 0}}finally{c? | ||
Q():K=!1}}}var Q;if("function"===typeof F)Q=function(){F(P)};else if("undefined"!==typeof MessageChannel){var R=new MessageChannel,S=R.port2;R.port1.onmessage=P;Q=function(){S.postMessage(null)}}else Q=function(){D(P,0)};function I(){K||(K=!0,Q())}function J(a,c){L=D(function(){a(exports.unstable_now())},c)}exports.unstable_IdlePriority=5;exports.unstable_ImmediatePriority=1;exports.unstable_LowPriority=4;exports.unstable_NormalPriority=3;exports.unstable_Profiling=null; | ||
exports.unstable_UserBlockingPriority=2;exports.unstable_cancelCallback=function(a){a.callback=null};exports.unstable_continueExecution=function(){A||z||(A=!0,I())};exports.unstable_forceFrameRate=function(a){0>a||125<a?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<a?Math.floor(1E3/a):5};exports.unstable_getCurrentPriorityLevel=function(){return y};exports.unstable_getFirstCallbackNode=function(){return h(q)}; | ||
exports.unstable_next=function(a){switch(y){case 1:case 2:case 3:var c=3;break;default:c=y}var b=y;y=c;try{return a()}finally{y=b}};exports.unstable_pauseExecution=function(){};exports.unstable_requestPaint=function(){};exports.unstable_runWithPriority=function(a,c){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var b=y;y=a;try{return c()}finally{y=b}}; | ||
exports.unstable_scheduleCallback=function(a,c,b){var d=exports.unstable_now();"object"===typeof b&&null!==b?(b=b.delay,b="number"===typeof b&&0<b?d+b:d):b=d;switch(a){case 1:var e=-1;break;case 2:e=250;break;case 5:e=1073741823;break;case 4:e=1E4;break;default:e=5E3}e=b+e;a={id:t++,callback:c,priorityLevel:a,startTime:b,expirationTime:e,sortIndex:-1};b>d?(a.sortIndex=b,f(r,a),null===h(q)&&a===h(r)&&(B?(E(L),L=-1):B=!0,J(H,b-d))):(a.sortIndex=e,f(q,a),A||z||(A=!0,I()));return a}; | ||
exports.unstable_shouldYield=O;exports.unstable_wrapCallback=function(a){var c=y;return function(){var b=y;y=c;try{return a.apply(this,arguments)}finally{y=b}}}; |
{ | ||
"name": "scheduler", | ||
"version": "0.24.0-canary-7118f5dd7-20230705", | ||
"version": "0.24.0-canary-720de7f81a-20241220", | ||
"description": "Cooperative scheduler for the browser environment.", | ||
@@ -5,0 +5,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
117147
2846