From 23b60dc1975db38c280d8a123aff97544d1673e0 Mon Sep 17 00:00:00 2001 From: HelenHuang <LinHuang@pollex.com.tw> Date: 星期四, 09 六月 2022 15:34:21 +0800 Subject: [PATCH] TODO#139890 FAQ 常見問題 1-文案調整 --- PAMapp/node_modules/@babel/preset-modules/lib/plugins/transform-tagged-template-caching/index.js | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/PAMapp/node_modules/@babel/preset-modules/lib/plugins/transform-tagged-template-caching/index.js b/PAMapp/node_modules/@babel/preset-modules/lib/plugins/transform-tagged-template-caching/index.js index 944647e..249a6c3 100644 --- a/PAMapp/node_modules/@babel/preset-modules/lib/plugins/transform-tagged-template-caching/index.js +++ b/PAMapp/node_modules/@babel/preset-modules/lib/plugins/transform-tagged-template-caching/index.js @@ -31,7 +31,7 @@ let processed = state.get("processed"); if (!processed) { - processed = new Map(); + processed = new WeakSet(); state.set("processed", processed); } @@ -54,13 +54,13 @@ // identity`a${0}` - const template = t.taggedTemplateExpression(identity, t.templateLiteral(path.node.quasi.quasis, expressions.map(() => t.numericLiteral(0)))); - processed.set(template, true); // Install an inline cache at the callsite using the global variable: + const template = t.taggedTemplateExpression(t.cloneNode(identity), t.templateLiteral(path.node.quasi.quasis, expressions.map(() => t.numericLiteral(0)))); + processed.add(template); // Install an inline cache at the callsite using the global variable: // _t || (_t = identity`a${0}`) const ident = path.scope.getProgramParent().generateDeclaredUidIdentifier("t"); path.scope.getBinding(ident.name).path.parent.kind = "let"; - const inlineCache = t.logicalExpression("||", ident, t.assignmentExpression("=", ident, template)); // The original tag function becomes a plain function call. + const inlineCache = t.logicalExpression("||", ident, t.assignmentExpression("=", t.cloneNode(ident), template)); // The original tag function becomes a plain function call. // The expressions omitted from the cached Strings tag are directly applied as arguments. // tag(_t || (_t = Object`a${0}`), 'hello') -- Gitblit v1.8.0