mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
0a28b34dac
Summary: On Hermes, RN can directly use the Promise from global w/o the need of polyfilling it. PromiseRejectionTrackingOptions are extracted to its own file so it can be shared by both codepaths and preserve the behaviors that it's only imported on dev. Some zero-overhead type gymnastics are used to flow-type it properly. Changelog: [General] - made promise polyfill conditionalized on Hermes Reviewed By: cpojer Differential Revision: D24068716 fbshipit-source-id: 3e0b1675493908324f27cc5b7300d8cc42a03acc
25 lines
548 B
JavaScript
25 lines
548 B
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @format
|
|
* @flow strict
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
const Promise = require('promise/setimmediate/es6-extensions');
|
|
|
|
require('promise/setimmediate/done');
|
|
require('promise/setimmediate/finally');
|
|
|
|
if (__DEV__) {
|
|
require('promise/setimmediate/rejection-tracking').enable(
|
|
require('./promiseRejectionTrackingOptions').default,
|
|
);
|
|
}
|
|
|
|
module.exports = Promise;
|