mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Fix global reference to Promise (#21926)
Referencing Promise without a type check will throw in environments where Promise is not defined. We will follow up with a lint rule that restricts access to all globals except in dedicated module indirections.
This commit is contained in:
+1
-1
@@ -392,7 +392,7 @@ export const scheduleTimeout: any =
|
||||
export const cancelTimeout: any =
|
||||
typeof clearTimeout === 'function' ? clearTimeout : (undefined: any);
|
||||
export const noTimeout = -1;
|
||||
const localPromise = Promise;
|
||||
const localPromise = typeof Promise === 'function' ? Promise : undefined;
|
||||
|
||||
// -------------------
|
||||
// Microtasks
|
||||
|
||||
Reference in New Issue
Block a user