- Timestamp:
- 11/25/21 22:08:24 (3 years ago)
- Branches:
- master
- Children:
- 8d391a1
- Parents:
- 59329aa
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trip-planner-front/node_modules/@babel/preset-modules/lib/plugins/transform-tagged-template-caching/index.js
r59329aa re29cc2e 32 32 33 33 if (!processed) { 34 processed = new Map();34 processed = new WeakSet(); 35 35 state.set("processed", processed); 36 36 } … … 55 55 56 56 57 const template = t.taggedTemplateExpression( identity, t.templateLiteral(path.node.quasi.quasis, expressions.map(() => t.numericLiteral(0))));58 processed. set(template, true); // Install an inline cache at the callsite using the global variable:57 const template = t.taggedTemplateExpression(t.cloneNode(identity), t.templateLiteral(path.node.quasi.quasis, expressions.map(() => t.numericLiteral(0)))); 58 processed.add(template); // Install an inline cache at the callsite using the global variable: 59 59 // _t || (_t = identity`a${0}`) 60 60 61 61 const ident = path.scope.getProgramParent().generateDeclaredUidIdentifier("t"); 62 62 path.scope.getBinding(ident.name).path.parent.kind = "let"; 63 const inlineCache = t.logicalExpression("||", ident, t.assignmentExpression("=", ident, template)); // The original tag function becomes a plain function call.63 const inlineCache = t.logicalExpression("||", ident, t.assignmentExpression("=", t.cloneNode(ident), template)); // The original tag function becomes a plain function call. 64 64 // The expressions omitted from the cached Strings tag are directly applied as arguments. 65 65 // tag(_t || (_t = Object`a${0}`), 'hello')
Note:
See TracChangeset
for help on using the changeset viewer.