UNPKG

782 BJavaScriptView Raw
1/**
2 * Copyright (c) Facebook, Inc. and its affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 *
7 * @flow strict-local
8 * @format
9 */
10'use strict';
11
12const {polyfillGlobal} = require('PolyfillFunctions');
13
14/**
15 * Set up regenerator.
16 * You can use this module directly, or just require InitializeCore.
17 */
18polyfillGlobal('regeneratorRuntime', () => {
19 // The require just sets up the global, so make sure when we first
20 // invoke it the global does not exist
21 delete global.regeneratorRuntime;
22
23 // regenerator-runtime/runtime exports the regeneratorRuntime object, so we
24 // can return it safely.
25 return require('regenerator-runtime/runtime'); // flowlint-line untyped-import:off
26});