You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
73 KiB

4 years ago
{"ast":null,"code":"/** @license React v0.19.1\n * scheduler.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function () {\n 'use strict';\n\n var enableSchedulerDebugging = false;\n var enableProfiling = true;\n var requestHostCallback;\n var requestHostTimeout;\n var cancelHostTimeout;\n var shouldYieldToHost;\n var requestPaint;\n\n if ( // If Scheduler runs in a non-DOM environment, it falls back to a naive\n // implementation using setTimeout.\n typeof window === 'undefined' || // Check if MessageChannel is supported, too.\n typeof MessageChannel !== 'function') {\n // If this accidentally gets imported in a non-browser environment, e.g. JavaScriptCore,\n // fallback to a naive implementation.\n var _callback = null;\n var _timeoutID = null;\n\n var _flushCallback = function () {\n if (_callback !== null) {\n try {\n var currentTime = exports.unstable_now();\n var hasRemainingTime = true;\n\n _callback(hasRemainingTime, currentTime);\n\n _callback = null;\n } catch (e) {\n setTimeout(_flushCallback, 0);\n throw e;\n }\n }\n };\n\n var initialTime = Date.now();\n\n exports.unstable_now = function () {\n return Date.now() - initialTime;\n };\n\n requestHostCallback = function (cb) {\n if (_callback !== null) {\n // Protect against re-entrancy.\n setTimeout(requestHostCallback, 0, cb);\n } else {\n _callback = cb;\n setTimeout(_flushCallback, 0);\n }\n };\n\n requestHostTimeout = function (cb, ms) {\n _timeoutID = setTimeout(cb, ms);\n };\n\n cancelHostTimeout = function () {\n clearTimeout(_timeoutID);\n };\n\n shouldYieldToHost = function () {\n return false;\n };\n\n requestPaint = exports.unstable_forceFrameRate = function () {};\n } else {\n // Capture local references to native APIs, in case a polyfill overrides them.\n var performance = window.performance;\n var _Date = window.Date;\n var _setTimeout = window.setTimeout;\n var _clearTimeout = window.clearTimeout;\n\n if (typeof console !== 'undefined') {\n // TODO: Scheduler no longer requires these methods to be polyfilled. But\n // maybe we want to continue warning if they don't exist, to preserve the\n // option to rely on it in the future?\n var requestAnimationFrame = window.requestAnimationFrame;\n var cancelAnimationFrame = window.cancelAnimationFrame; // TODO: Remove fb.me link\n\n if (typeof requestAnimationFrame !== 'function') {\n // Using console['error'] to evade Babel and ESLint\n console['error'](\"This browser doesn't support requestAnimationFrame. \" + 'Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills');\n }\n\n if (typeof cancelAnimationFrame !== 'function') {\n // Using console['error'] to evade Babel and ESLint\n console['error'](\"This browser doesn't support cancelAnimationFrame. \" + 'Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills');\n }\n }\n\n if (typeof performance === 'object' && typeof performance.now === 'function') {\n exports.unstable_now = function () {\n return performance.now();\n };\n } else {\n var _initialTime = _Date.now();\n\n exports.unstable_now = function () {\n return _Date.now() - _initialTime;\n };\n }\n\n var isMessageLoopRunning = false;\n var scheduledHostCallback = null;\n var taskTimeoutID = -1; // Scheduler periodically yields in case there is other work on the main\n // t