Lazy load tagged template literal strings (#7855)

* Lazy load tagged template literal strings

* Update snapshots to reflect lazy loading

* Use pure annotation and remove unnecessary parenthesized expression

* Update snapshots

* Optimize lazy loading by doing assignment within logical expression

* Update snapshots to reflect optimization

* Use re-define function pattern to avoid hitting function size deopts

* Update snapshots to reflect the usage of the redefining function pattern
This commit is contained in:
Dennis Czombera
2018-05-10 20:54:10 +02:00
committed by Justin Ridgewell
parent 25c3f0d689
commit 4260ffd7ec
9 changed files with 314 additions and 67 deletions

View File

@@ -4,6 +4,14 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
var _templateObject = /*#__PURE__*/ (0, _taggedTemplateLiteral2.default)(["foo"]);
function _templateObject() {
const data = /*#__PURE__*/ (0, _taggedTemplateLiteral2.default)(["foo"]);
tag(_templateObject);
_templateObject = function () {
return data;
};
return data;
}
tag(_templateObject());

View File

@@ -4,6 +4,14 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
var _templateObject = /*#__PURE__*/ (0, _taggedTemplateLiteral2.default)(["foo"]);
function _templateObject() {
const data = /*#__PURE__*/ (0, _taggedTemplateLiteral2.default)(["foo"]);
tag(_templateObject);
_templateObject = function () {
return data;
};
return data;
}
tag(_templateObject());