Add taggedTemplateLiteral to babelHelpers
Summary: Needed to support tagged template literals (which are already enabled in babel). Not having this helper means we get a runtime crash. Closes https://github.com/facebook/react-native/pull/4680 Reviewed By: svcscm Differential Revision: D2740233 Pulled By: spicyj fb-gh-sync-id: 12729f670b7942ad7a04bd50ae1eca35d2b1e410
This commit is contained in:
parent
c0c8e7cfdf
commit
053a2294b8
|
@ -11,7 +11,7 @@
|
|||
/* eslint-disable strict */
|
||||
|
||||
// Created by running:
|
||||
// require('babel-core').buildExternalHelpers('_extends classCallCheck createClass createRawReactElement defineProperty get inherits interopRequireDefault interopRequireWildcard objectWithoutProperties possibleConstructorReturn slicedToArray toConsumableArray'.split(' '))
|
||||
// require('babel-core').buildExternalHelpers('_extends classCallCheck createClass createRawReactElement defineProperty get inherits interopRequireDefault interopRequireWildcard objectWithoutProperties possibleConstructorReturn slicedToArray taggedTemplateLiteral toConsumableArray '.split(' '))
|
||||
// then replacing the `global` reference in the last line to also use `this`.
|
||||
//
|
||||
// actually, that's a lie, because babel6 omits _extends and createRawReactElement
|
||||
|
@ -208,6 +208,14 @@
|
|||
};
|
||||
})();
|
||||
|
||||
babelHelpers.taggedTemplateLiteral = function (strings, raw) {
|
||||
return Object.freeze(Object.defineProperties(strings, {
|
||||
raw: {
|
||||
value: Object.freeze(raw)
|
||||
}
|
||||
}));
|
||||
};
|
||||
|
||||
babelHelpers.toConsumableArray = function (arr) {
|
||||
if (Array.isArray(arr)) {
|
||||
for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
|
||||
|
|
Loading…
Reference in New Issue