UNPKG

23 kBJavaScriptView Raw
1/** @license React v0.17.0
2 * scheduler-unstable_mock.development.js
3 *
4 * Copyright (c) Facebook, Inc. and its affiliates.
5 *
6 * This source code is licensed under the MIT license found in the
7 * LICENSE file in the root directory of this source tree.
8 */
9
10'use strict';
11
12
13
14if (process.env.NODE_ENV !== "production") {
15 (function() {
16'use strict';
17
18Object.defineProperty(exports, '__esModule', { value: true });
19
20var enableSchedulerDebugging = false;
21
22
23var enableProfiling = true;
24
25var currentTime = 0;
26var scheduledCallback = null;
27var scheduledTimeout = null;
28var timeoutTime = -1;
29var yieldedValues = null;
30var expectedNumberOfYields = -1;
31var didStop = false;
32var isFlushing = false;
33var needsPaint = false;
34var shouldYieldForPaint = false;
35function requestHostCallback(callback) {
36 scheduledCallback = callback;
37}
38
39function requestHostTimeout(callback, ms) {
40 scheduledTimeout = callback;
41 timeoutTime = currentTime + ms;
42}
43function cancelHostTimeout() {
44 scheduledTimeout = null;
45 timeoutTime = -1;
46}
47function shouldYieldToHost() {
48 if (expectedNumberOfYields !== -1 && yieldedValues !== null && yieldedValues.length >= expectedNumberOfYields || shouldYieldForPaint && needsPaint) {
49 // We yielded at least as many values as expected. Stop flushing.
50 didStop = true;
51 return true;
52 }
53
54 return false;
55}
56function getCurrentTime() {
57 return currentTime;
58}
59function forceFrameRate() {// No-op
60}
61 // Should only be used via an assertion helper that inspects the yielded values.
62
63function unstable_flushNumberOfYields(count) {
64 if (isFlushing) {
65 throw new Error('Already flushing work.');
66 }
67
68 if (scheduledCallback !== null) {
69 var cb = scheduledCallback;
70 expectedNumberOfYields = count;
71 isFlushing = true;
72
73 try {
74 var hasMoreWork = true;
75
76 do {
77 hasMoreWork = cb(true, currentTime);
78 } while (hasMoreWork && !didStop);
79
80 if (!hasMoreWork) {
81 scheduledCallback = null;
82 }
83 } finally {
84 expectedNumberOfYields = -1;
85 didStop = false;
86 isFlushing = false;
87 }
88 }
89}
90function unstable_flushUntilNextPaint() {
91 if (isFlushing) {
92 throw new Error('Already flushing work.');
93 }
94
95 if (scheduledCallback !== null) {
96 var cb = scheduledCallback;
97 shouldYieldForPaint = true;
98 needsPaint = false;
99 isFlushing = true;
100
101 try {
102 var hasMoreWork = true;
103
104 do {
105 hasMoreWork = cb(true, currentTime);
106 } while (hasMoreWork && !didStop);
107
108 if (!hasMoreWork) {
109 scheduledCallback = null;
110 }
111 } finally {
112 shouldYieldForPaint = false;
113 didStop = false;
114 isFlushing = false;
115 }
116 }
117}
118function unstable_flushExpired() {
119 if (isFlushing) {
120 throw new Error('Already flushing work.');
121 }
122
123 if (scheduledCallback !== null) {
124 isFlushing = true;
125
126 try {
127 var hasMoreWork = scheduledCallback(false, currentTime);
128
129 if (!hasMoreWork) {
130 scheduledCallback = null;
131 }
132 } finally {
133 isFlushing = false;
134 }
135 }
136}
137function unstable_flushAllWithoutAsserting() {
138 // Returns false if no work was flushed.
139 if (isFlushing) {
140 throw new Error('Already flushing work.');
141 }
142
143 if (scheduledCallback !== null) {
144 var cb = scheduledCallback;
145 isFlushing = true;
146
147 try {
148 var hasMoreWork = true;
149
150 do {
151 hasMoreWork = cb(true, currentTime);
152 } while (hasMoreWork);
153
154 if (!hasMoreWork) {
155 scheduledCallback = null;
156 }
157
158 return true;
159 } finally {
160 isFlushing = false;
161 }
162 } else {
163 return false;
164 }
165}
166function unstable_clearYields() {
167 if (yieldedValues === null) {
168 return [];
169 }
170
171 var values = yieldedValues;
172 yieldedValues = null;
173 return values;
174}
175function unstable_flushAll() {
176 if (yieldedValues !== null) {
177 throw new Error('Log is not empty. Assert on the log of yielded values before ' + 'flushing additional work.');
178 }
179
180 unstable_flushAllWithoutAsserting();
181
182 if (yieldedValues !== null) {
183 throw new Error('While flushing work, something yielded a value. Use an ' + 'assertion helper to assert on the log of yielded values, e.g. ' + 'expect(Scheduler).toFlushAndYield([...])');
184 }
185}
186function unstable_yieldValue(value) {
187 if (yieldedValues === null) {
188 yieldedValues = [value];
189 } else {
190 yieldedValues.push(value);
191 }
192}
193function unstable_advanceTime(ms) {
194 currentTime += ms;
195
196 if (!isFlushing) {
197 if (scheduledTimeout !== null && timeoutTime <= currentTime) {
198 scheduledTimeout(currentTime);
199 timeoutTime = -1;
200 scheduledTimeout = null;
201 }
202
203 unstable_flushExpired();
204 }
205}
206function requestPaint() {
207 needsPaint = true;
208}
209
210function push(heap, node) {
211 var index = heap.length;
212 heap.push(node);
213 siftUp(heap, node, index);
214}
215function peek(heap) {
216 var first = heap[0];
217 return first === undefined ? null : first;
218}
219function pop(heap) {
220 var first = heap[0];
221
222 if (first !== undefined) {
223 var last = heap.pop();
224
225 if (last !== first) {
226 heap[0] = last;
227 siftDown(heap, last, 0);
228 }
229
230 return first;
231 } else {
232 return null;
233 }
234}
235
236function siftUp(heap, node, i) {
237 var index = i;
238
239 while (true) {
240 var parentIndex = Math.floor((index - 1) / 2);
241 var parent = heap[parentIndex];
242
243 if (parent !== undefined && compare(parent, node) > 0) {
244 // The parent is larger. Swap positions.
245 heap[parentIndex] = node;
246 heap[index] = parent;
247 index = parentIndex;
248 } else {
249 // The parent is smaller. Exit.
250 return;
251 }
252 }
253}
254
255function siftDown(heap, node, i) {
256 var index = i;
257 var length = heap.length;
258
259 while (index < length) {
260 var leftIndex = (index + 1) * 2 - 1;
261 var left = heap[leftIndex];
262 var rightIndex = leftIndex + 1;
263 var right = heap[rightIndex]; // If the left or right node is smaller, swap with the smaller of those.
264
265 if (left !== undefined && compare(left, node) < 0) {
266 if (right !== undefined && compare(right, left) < 0) {
267 heap[index] = right;
268 heap[rightIndex] = node;
269 index = rightIndex;
270 } else {
271 heap[index] = left;
272 heap[leftIndex] = node;
273 index = leftIndex;
274 }
275 } else if (right !== undefined && compare(right, node) < 0) {
276 heap[index] = right;
277 heap[rightIndex] = node;
278 index = rightIndex;
279 } else {
280 // Neither child is smaller. Exit.
281 return;
282 }
283 }
284}
285
286function compare(a, b) {
287 // Compare sort index first, then task id.
288 var diff = a.sortIndex - b.sortIndex;
289 return diff !== 0 ? diff : a.id - b.id;
290}
291
292// TODO: Use symbols?
293var NoPriority = 0;
294var ImmediatePriority = 1;
295var UserBlockingPriority = 2;
296var NormalPriority = 3;
297var LowPriority = 4;
298var IdlePriority = 5;
299
300var runIdCounter = 0;
301var mainThreadIdCounter = 0;
302var profilingStateSize = 4;
303var sharedProfilingBuffer = enableProfiling ? // $FlowFixMe Flow doesn't know about SharedArrayBuffer
304typeof SharedArrayBuffer === 'function' ? new SharedArrayBuffer(profilingStateSize * Int32Array.BYTES_PER_ELEMENT) : // $FlowFixMe Flow doesn't know about ArrayBuffer
305typeof ArrayBuffer === 'function' ? new ArrayBuffer(profilingStateSize * Int32Array.BYTES_PER_ELEMENT) : null // Don't crash the init path on IE9
306: null;
307var profilingState = enableProfiling && sharedProfilingBuffer !== null ? new Int32Array(sharedProfilingBuffer) : []; // We can't read this but it helps save bytes for null checks
308
309var PRIORITY = 0;
310var CURRENT_TASK_ID = 1;
311var CURRENT_RUN_ID = 2;
312var QUEUE_SIZE = 3;
313
314if (enableProfiling) {
315 profilingState[PRIORITY] = NoPriority; // This is maintained with a counter, because the size of the priority queue
316 // array might include canceled tasks.
317
318 profilingState[QUEUE_SIZE] = 0;
319 profilingState[CURRENT_TASK_ID] = 0;
320} // Bytes per element is 4
321
322
323var INITIAL_EVENT_LOG_SIZE = 131072;
324var MAX_EVENT_LOG_SIZE = 524288; // Equivalent to 2 megabytes
325
326var eventLogSize = 0;
327var eventLogBuffer = null;
328var eventLog = null;
329var eventLogIndex = 0;
330var TaskStartEvent = 1;
331var TaskCompleteEvent = 2;
332var TaskErrorEvent = 3;
333var TaskCancelEvent = 4;
334var TaskRunEvent = 5;
335var TaskYieldEvent = 6;
336var SchedulerSuspendEvent = 7;
337var SchedulerResumeEvent = 8;
338
339function logEvent(entries) {
340 if (eventLog !== null) {
341 var offset = eventLogIndex;
342 eventLogIndex += entries.length;
343
344 if (eventLogIndex + 1 > eventLogSize) {
345 eventLogSize *= 2;
346
347 if (eventLogSize > MAX_EVENT_LOG_SIZE) {
348 console.error("Scheduler Profiling: Event log exceeded maximum size. Don't " + 'forget to call `stopLoggingProfilingEvents()`.');
349 stopLoggingProfilingEvents();
350 return;
351 }
352
353 var newEventLog = new Int32Array(eventLogSize * 4);
354 newEventLog.set(eventLog);
355 eventLogBuffer = newEventLog.buffer;
356 eventLog = newEventLog;
357 }
358
359 eventLog.set(entries, offset);
360 }
361}
362
363function startLoggingProfilingEvents() {
364 eventLogSize = INITIAL_EVENT_LOG_SIZE;
365 eventLogBuffer = new ArrayBuffer(eventLogSize * 4);
366 eventLog = new Int32Array(eventLogBuffer);
367 eventLogIndex = 0;
368}
369function stopLoggingProfilingEvents() {
370 var buffer = eventLogBuffer;
371 eventLogSize = 0;
372 eventLogBuffer = null;
373 eventLog = null;
374 eventLogIndex = 0;
375 return buffer;
376}
377function markTaskStart(task, ms) {
378 if (enableProfiling) {
379 profilingState[QUEUE_SIZE]++;
380
381 if (eventLog !== null) {
382 // performance.now returns a float, representing milliseconds. When the
383 // event is logged, it's coerced to an int. Convert to microseconds to
384 // maintain extra degrees of precision.
385 logEvent([TaskStartEvent, ms * 1000, task.id, task.priorityLevel]);
386 }
387 }
388}
389function markTaskCompleted(task, ms) {
390 if (enableProfiling) {
391 profilingState[PRIORITY] = NoPriority;
392 profilingState[CURRENT_TASK_ID] = 0;
393 profilingState[QUEUE_SIZE]--;
394
395 if (eventLog !== null) {
396 logEvent([TaskCompleteEvent, ms * 1000, task.id]);
397 }
398 }
399}
400function markTaskCanceled(task, ms) {
401 if (enableProfiling) {
402 profilingState[QUEUE_SIZE]--;
403
404 if (eventLog !== null) {
405 logEvent([TaskCancelEvent, ms * 1000, task.id]);
406 }
407 }
408}
409function markTaskErrored(task, ms) {
410 if (enableProfiling) {
411 profilingState[PRIORITY] = NoPriority;
412 profilingState[CURRENT_TASK_ID] = 0;
413 profilingState[QUEUE_SIZE]--;
414
415 if (eventLog !== null) {
416 logEvent([TaskErrorEvent, ms * 1000, task.id]);
417 }
418 }
419}
420function markTaskRun(task, ms) {
421 if (enableProfiling) {
422 runIdCounter++;
423 profilingState[PRIORITY] = task.priorityLevel;
424 profilingState[CURRENT_TASK_ID] = task.id;
425 profilingState[CURRENT_RUN_ID] = runIdCounter;
426
427 if (eventLog !== null) {
428 logEvent([TaskRunEvent, ms * 1000, task.id, runIdCounter]);
429 }
430 }
431}
432function markTaskYield(task, ms) {
433 if (enableProfiling) {
434 profilingState[PRIORITY] = NoPriority;
435 profilingState[CURRENT_TASK_ID] = 0;
436 profilingState[CURRENT_RUN_ID] = 0;
437
438 if (eventLog !== null) {
439 logEvent([TaskYieldEvent, ms * 1000, task.id, runIdCounter]);
440 }
441 }
442}
443function markSchedulerSuspended(ms) {
444 if (enableProfiling) {
445 mainThreadIdCounter++;
446
447 if (eventLog !== null) {
448 logEvent([SchedulerSuspendEvent, ms * 1000, mainThreadIdCounter]);
449 }
450 }
451}
452function markSchedulerUnsuspended(ms) {
453 if (enableProfiling) {
454 if (eventLog !== null) {
455 logEvent([SchedulerResumeEvent, ms * 1000, mainThreadIdCounter]);
456 }
457 }
458}
459
460/* eslint-disable no-var */
461// Math.pow(2, 30) - 1
462// 0b111111111111111111111111111111
463
464var maxSigned31BitInt = 1073741823; // Times out immediately
465
466var IMMEDIATE_PRIORITY_TIMEOUT = -1; // Eventually times out
467
468var USER_BLOCKING_PRIORITY = 250;
469var NORMAL_PRIORITY_TIMEOUT = 5000;
470var LOW_PRIORITY_TIMEOUT = 10000; // Never times out
471
472var IDLE_PRIORITY = maxSigned31BitInt; // Tasks are stored on a min heap
473
474var taskQueue = [];
475var timerQueue = []; // Incrementing id counter. Used to maintain insertion order.
476
477var taskIdCounter = 1; // Pausing the scheduler is useful for debugging.
478
479var isSchedulerPaused = false;
480var currentTask = null;
481var currentPriorityLevel = NormalPriority; // This is set while performing work, to prevent re-entrancy.
482
483var isPerformingWork = false;
484var isHostCallbackScheduled = false;
485var isHostTimeoutScheduled = false;
486
487function advanceTimers(currentTime) {
488 // Check for tasks that are no longer delayed and add them to the queue.
489 var timer = peek(timerQueue);
490
491 while (timer !== null) {
492 if (timer.callback === null) {
493 // Timer was cancelled.
494 pop(timerQueue);
495 } else if (timer.startTime <= currentTime) {
496 // Timer fired. Transfer to the task queue.
497 pop(timerQueue);
498 timer.sortIndex = timer.expirationTime;
499 push(taskQueue, timer);
500
501 if (enableProfiling) {
502 markTaskStart(timer, currentTime);
503 timer.isQueued = true;
504 }
505 } else {
506 // Remaining timers are pending.
507 return;
508 }
509
510 timer = peek(timerQueue);
511 }
512}
513
514function handleTimeout(currentTime) {
515 isHostTimeoutScheduled = false;
516 advanceTimers(currentTime);
517
518 if (!isHostCallbackScheduled) {
519 if (peek(taskQueue) !== null) {
520 isHostCallbackScheduled = true;
521 requestHostCallback(flushWork);
522 } else {
523 var firstTimer = peek(timerQueue);
524
525 if (firstTimer !== null) {
526 requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
527 }
528 }
529 }
530}
531
532function flushWork(hasTimeRemaining, initialTime) {
533 if (enableProfiling) {
534 markSchedulerUnsuspended(initialTime);
535 } // We'll need a host callback the next time work is scheduled.
536
537
538 isHostCallbackScheduled = false;
539
540 if (isHostTimeoutScheduled) {
541 // We scheduled a timeout but it's no longer needed. Cancel it.
542 isHostTimeoutScheduled = false;
543 cancelHostTimeout();
544 }
545
546 isPerformingWork = true;
547 var previousPriorityLevel = currentPriorityLevel;
548
549 try {
550 if (enableProfiling) {
551 try {
552 return workLoop(hasTimeRemaining, initialTime);
553 } catch (error) {
554 if (currentTask !== null) {
555 var currentTime = getCurrentTime();
556 markTaskErrored(currentTask, currentTime);
557 currentTask.isQueued = false;
558 }
559
560 throw error;
561 }
562 } else {
563 // No catch in prod codepath.
564 return workLoop(hasTimeRemaining, initialTime);
565 }
566 } finally {
567 currentTask = null;
568 currentPriorityLevel = previousPriorityLevel;
569 isPerformingWork = false;
570
571 if (enableProfiling) {
572 var _currentTime = getCurrentTime();
573
574 markSchedulerSuspended(_currentTime);
575 }
576 }
577}
578
579function workLoop(hasTimeRemaining, initialTime) {
580 var currentTime = initialTime;
581 advanceTimers(currentTime);
582 currentTask = peek(taskQueue);
583
584 while (currentTask !== null && !(enableSchedulerDebugging && isSchedulerPaused)) {
585 if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {
586 // This currentTask hasn't expired, and we've reached the deadline.
587 break;
588 }
589
590 var callback = currentTask.callback;
591
592 if (callback !== null) {
593 currentTask.callback = null;
594 currentPriorityLevel = currentTask.priorityLevel;
595 var didUserCallbackTimeout = currentTask.expirationTime <= currentTime;
596 markTaskRun(currentTask, currentTime);
597 var continuationCallback = callback(didUserCallbackTimeout);
598 currentTime = getCurrentTime();
599
600 if (typeof continuationCallback === 'function') {
601 currentTask.callback = continuationCallback;
602 markTaskYield(currentTask, currentTime);
603 } else {
604 if (enableProfiling) {
605 markTaskCompleted(currentTask, currentTime);
606 currentTask.isQueued = false;
607 }
608
609 if (currentTask === peek(taskQueue)) {
610 pop(taskQueue);
611 }
612 }
613
614 advanceTimers(currentTime);
615 } else {
616 pop(taskQueue);
617 }
618
619 currentTask = peek(taskQueue);
620 } // Return whether there's additional work
621
622
623 if (currentTask !== null) {
624 return true;
625 } else {
626 var firstTimer = peek(timerQueue);
627
628 if (firstTimer !== null) {
629 requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
630 }
631
632 return false;
633 }
634}
635
636function unstable_runWithPriority(priorityLevel, eventHandler) {
637 switch (priorityLevel) {
638 case ImmediatePriority:
639 case UserBlockingPriority:
640 case NormalPriority:
641 case LowPriority:
642 case IdlePriority:
643 break;
644
645 default:
646 priorityLevel = NormalPriority;
647 }
648
649 var previousPriorityLevel = currentPriorityLevel;
650 currentPriorityLevel = priorityLevel;
651
652 try {
653 return eventHandler();
654 } finally {
655 currentPriorityLevel = previousPriorityLevel;
656 }
657}
658
659function unstable_next(eventHandler) {
660 var priorityLevel;
661
662 switch (currentPriorityLevel) {
663 case ImmediatePriority:
664 case UserBlockingPriority:
665 case NormalPriority:
666 // Shift down to normal priority
667 priorityLevel = NormalPriority;
668 break;
669
670 default:
671 // Anything lower than normal priority should remain at the current level.
672 priorityLevel = currentPriorityLevel;
673 break;
674 }
675
676 var previousPriorityLevel = currentPriorityLevel;
677 currentPriorityLevel = priorityLevel;
678
679 try {
680 return eventHandler();
681 } finally {
682 currentPriorityLevel = previousPriorityLevel;
683 }
684}
685
686function unstable_wrapCallback(callback) {
687 var parentPriorityLevel = currentPriorityLevel;
688 return function () {
689 // This is a fork of runWithPriority, inlined for performance.
690 var previousPriorityLevel = currentPriorityLevel;
691 currentPriorityLevel = parentPriorityLevel;
692
693 try {
694 return callback.apply(this, arguments);
695 } finally {
696 currentPriorityLevel = previousPriorityLevel;
697 }
698 };
699}
700
701function timeoutForPriorityLevel(priorityLevel) {
702 switch (priorityLevel) {
703 case ImmediatePriority:
704 return IMMEDIATE_PRIORITY_TIMEOUT;
705
706 case UserBlockingPriority:
707 return USER_BLOCKING_PRIORITY;
708
709 case IdlePriority:
710 return IDLE_PRIORITY;
711
712 case LowPriority:
713 return LOW_PRIORITY_TIMEOUT;
714
715 case NormalPriority:
716 default:
717 return NORMAL_PRIORITY_TIMEOUT;
718 }
719}
720
721function unstable_scheduleCallback(priorityLevel, callback, options) {
722 var currentTime = getCurrentTime();
723 var startTime;
724 var timeout;
725
726 if (typeof options === 'object' && options !== null) {
727 var delay = options.delay;
728
729 if (typeof delay === 'number' && delay > 0) {
730 startTime = currentTime + delay;
731 } else {
732 startTime = currentTime;
733 }
734
735 timeout = typeof options.timeout === 'number' ? options.timeout : timeoutForPriorityLevel(priorityLevel);
736 } else {
737 timeout = timeoutForPriorityLevel(priorityLevel);
738 startTime = currentTime;
739 }
740
741 var expirationTime = startTime + timeout;
742 var newTask = {
743 id: taskIdCounter++,
744 callback: callback,
745 priorityLevel: priorityLevel,
746 startTime: startTime,
747 expirationTime: expirationTime,
748 sortIndex: -1
749 };
750
751 if (enableProfiling) {
752 newTask.isQueued = false;
753 }
754
755 if (startTime > currentTime) {
756 // This is a delayed task.
757 newTask.sortIndex = startTime;
758 push(timerQueue, newTask);
759
760 if (peek(taskQueue) === null && newTask === peek(timerQueue)) {
761 // All tasks are delayed, and this is the task with the earliest delay.
762 if (isHostTimeoutScheduled) {
763 // Cancel an existing timeout.
764 cancelHostTimeout();
765 } else {
766 isHostTimeoutScheduled = true;
767 } // Schedule a timeout.
768
769
770 requestHostTimeout(handleTimeout, startTime - currentTime);
771 }
772 } else {
773 newTask.sortIndex = expirationTime;
774 push(taskQueue, newTask);
775
776 if (enableProfiling) {
777 markTaskStart(newTask, currentTime);
778 newTask.isQueued = true;
779 } // Schedule a host callback, if needed. If we're already performing work,
780 // wait until the next time we yield.
781
782
783 if (!isHostCallbackScheduled && !isPerformingWork) {
784 isHostCallbackScheduled = true;
785 requestHostCallback(flushWork);
786 }
787 }
788
789 return newTask;
790}
791
792function unstable_pauseExecution() {
793 isSchedulerPaused = true;
794}
795
796function unstable_continueExecution() {
797 isSchedulerPaused = false;
798
799 if (!isHostCallbackScheduled && !isPerformingWork) {
800 isHostCallbackScheduled = true;
801 requestHostCallback(flushWork);
802 }
803}
804
805function unstable_getFirstCallbackNode() {
806 return peek(taskQueue);
807}
808
809function unstable_cancelCallback(task) {
810 if (enableProfiling) {
811 if (task.isQueued) {
812 var currentTime = getCurrentTime();
813 markTaskCanceled(task, currentTime);
814 task.isQueued = false;
815 }
816 } // Null out the callback to indicate the task has been canceled. (Can't
817 // remove from the queue because you can't remove arbitrary nodes from an
818 // array based heap, only the first one.)
819
820
821 task.callback = null;
822}
823
824function unstable_getCurrentPriorityLevel() {
825 return currentPriorityLevel;
826}
827
828function unstable_shouldYield() {
829 var currentTime = getCurrentTime();
830 advanceTimers(currentTime);
831 var firstTask = peek(taskQueue);
832 return firstTask !== currentTask && currentTask !== null && firstTask !== null && firstTask.callback !== null && firstTask.startTime <= currentTime && firstTask.expirationTime < currentTask.expirationTime || shouldYieldToHost();
833}
834
835var unstable_requestPaint = requestPaint;
836var unstable_Profiling = enableProfiling ? {
837 startLoggingProfilingEvents: startLoggingProfilingEvents,
838 stopLoggingProfilingEvents: stopLoggingProfilingEvents,
839 sharedProfilingBuffer: sharedProfilingBuffer
840} : null;
841
842exports.unstable_flushAllWithoutAsserting = unstable_flushAllWithoutAsserting;
843exports.unstable_flushNumberOfYields = unstable_flushNumberOfYields;
844exports.unstable_flushExpired = unstable_flushExpired;
845exports.unstable_clearYields = unstable_clearYields;
846exports.unstable_flushUntilNextPaint = unstable_flushUntilNextPaint;
847exports.unstable_flushAll = unstable_flushAll;
848exports.unstable_yieldValue = unstable_yieldValue;
849exports.unstable_advanceTime = unstable_advanceTime;
850exports.unstable_ImmediatePriority = ImmediatePriority;
851exports.unstable_UserBlockingPriority = UserBlockingPriority;
852exports.unstable_NormalPriority = NormalPriority;
853exports.unstable_IdlePriority = IdlePriority;
854exports.unstable_LowPriority = LowPriority;
855exports.unstable_runWithPriority = unstable_runWithPriority;
856exports.unstable_next = unstable_next;
857exports.unstable_scheduleCallback = unstable_scheduleCallback;
858exports.unstable_cancelCallback = unstable_cancelCallback;
859exports.unstable_wrapCallback = unstable_wrapCallback;
860exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel;
861exports.unstable_shouldYield = unstable_shouldYield;
862exports.unstable_requestPaint = unstable_requestPaint;
863exports.unstable_continueExecution = unstable_continueExecution;
864exports.unstable_pauseExecution = unstable_pauseExecution;
865exports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode;
866exports.unstable_now = getCurrentTime;
867exports.unstable_forceFrameRate = forceFrameRate;
868exports.unstable_Profiling = unstable_Profiling;
869 })();
870}