Revert D5388655: BREAKING: Add regenerator-runtime on demand, based on the files

Differential Revision: D5388655

fbshipit-source-id: 2f92d6ae69f4772195aeca7493f53209388b3ad0
This commit is contained in:
Miguel Jimenez Esun 2017-07-19 11:54:16 -07:00 committed by Facebook Github Bot
parent 0d16c7c982
commit 737abe3b76
4 changed files with 16 additions and 7 deletions

View File

@ -138,6 +138,15 @@ defineProperty(global, 'Set', () => require('Set'), true);
// ERROR: Event loop not supported. // ERROR: Event loop not supported.
defineProperty(global, 'Promise', () => require('Promise')); defineProperty(global, 'Promise', () => require('Promise'));
// Set up regenerator.
defineProperty(global, 'regeneratorRuntime', () => {
// The require just sets up the global, so make sure when we first
// invoke it the global does not exist
delete global.regeneratorRuntime;
require('regenerator-runtime/runtime');
return global.regeneratorRuntime;
});
// Set up timers // Set up timers
const defineLazyTimer = name => { const defineLazyTimer = name => {
defineProperty(global, name, () => require('JSTimers')[name]); defineProperty(global, name, () => require('JSTimers')[name]);

View File

@ -163,11 +163,11 @@ const THUMB_URLS = [
require('./Thumbnails/victory.png'), require('./Thumbnails/victory.png'),
]; ];
const LOREM_IPSUM = 'Lorem ipsum dolor sit amet, ius ad pertinax oportere accommodare, an vix ' + const LOREM_IPSUM = 'Lorem ipsum dolor sit amet, ius ad pertinax oportere accommodare, an vix \
'civibus corrumpit referrentur. Te nam case ludus inciderint, te mea facilisi adipiscing. Sea id ' + civibus corrumpit referrentur. Te nam case ludus inciderint, te mea facilisi adipiscing. Sea id \
'integre luptatum. In tota sale consequuntur nec. Erat ocurreret mei ei. Eu paulo sapientem ' + integre luptatum. In tota sale consequuntur nec. Erat ocurreret mei ei. Eu paulo sapientem \
'vulputate est, vel an accusam intellegam interesset. Nam eu stet pericula reprimique, ea vim illud ' + vulputate est, vel an accusam intellegam interesset. Nam eu stet pericula reprimique, ea vim illud \
'modus, putant invidunt reprehendunt ne qui.'; modus, putant invidunt reprehendunt ne qui.';
/* eslint no-bitwise: 0 */ /* eslint no-bitwise: 0 */
function hashCode(str: string): number { function hashCode(str: string): number {

View File

@ -1,6 +1,6 @@
{ {
"name": "babel-preset-react-native", "name": "babel-preset-react-native",
"version": "2.1.0", "version": "2.0.0",
"description": "Babel preset for React Native applications", "description": "Babel preset for React Native applications",
"main": "index.js", "main": "index.js",
"repository": "https://github.com/facebook/react-native/tree/master/babel-preset", "repository": "https://github.com/facebook/react-native/tree/master/babel-preset",

View File

@ -150,7 +150,7 @@
"babel-polyfill": "^6.20.0", "babel-polyfill": "^6.20.0",
"babel-preset-es2015-node": "^6.1.1", "babel-preset-es2015-node": "^6.1.1",
"babel-preset-fbjs": "^2.1.4", "babel-preset-fbjs": "^2.1.4",
"babel-preset-react-native": "^2.1.0", "babel-preset-react-native": "^2.0.0",
"babel-register": "^6.24.1", "babel-register": "^6.24.1",
"babel-runtime": "^6.23.0", "babel-runtime": "^6.23.0",
"babel-traverse": "^6.24.1", "babel-traverse": "^6.24.1",