Skip to content

Commit

Permalink
Prevent deopt from adding isQueued later
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Aug 21, 2019
1 parent 1efd7c5 commit 9c30b0b
Showing 1 changed file with 24 additions and 13 deletions.
37 changes: 24 additions & 13 deletions packages/scheduler/src/Scheduler.js
Expand Up @@ -328,20 +328,31 @@ function unstable_scheduleCallback(priorityLevel, callback, options) {

var expirationTime = startTime + timeout;

var newTask = {
id: ++taskIdCounter,
callback,
priorityLevel,
startTime,
expirationTime,
sortIndex: -1,
};

var newTask;
if (enableProfiling) {
newTask.isQueued = false;
// if (typeof options === 'object' && options !== null) {
// newTask.label = label;
// }
newTask = {
// __PROFILER__ only
isQueued: false,
// label: label

// !!! Keep these in sync with below branch !!!
id: ++taskIdCounter,
callback,
priorityLevel,
startTime,
expirationTime,
sortIndex: -1,
};
} else {
newTask = {
// !!! Keep these in sync with above branch !!!
id: ++taskIdCounter,
callback,
priorityLevel,
startTime,
expirationTime,
sortIndex: -1,
};
}

if (startTime > currentTime) {
Expand Down

0 comments on commit 9c30b0b

Please sign in to comment.