@babel/preset-modules
Advanced tools
Comparing version 0.1.4 to 0.1.5
@@ -34,3 +34,3 @@ "use strict"; | ||
if (!processed) { | ||
processed = new Map(); | ||
processed = new WeakSet(); | ||
state.set("processed", processed); | ||
@@ -58,4 +58,4 @@ } | ||
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}`) | ||
@@ -65,3 +65,3 @@ | ||
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. | ||
@@ -68,0 +68,0 @@ // tag(_t || (_t = Object`a${0}`), 'hello') |
{ | ||
"name": "@babel/preset-modules", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "A Babel preset that targets modern browsers by fixing engine bugs.", | ||
@@ -18,2 +18,6 @@ "main": "lib/index.js", | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/babel/preset-modules.git" | ||
}, | ||
"keywords": [ | ||
@@ -70,3 +74,3 @@ "babel", | ||
"@babel/helper-fixtures": "^7.6.3", | ||
"@babel/helper-plugin-test-runner": "^7.1.0", | ||
"@babel/helper-plugin-test-runner": "^7.14.5", | ||
"@babel/plugin-transform-modules-commonjs": "^7.5.0", | ||
@@ -73,0 +77,0 @@ "@babel/plugin-transform-react-jsx": "^7.7.0", |
@@ -142,3 +142,3 @@ # `@babel/preset-modules` | ||
terser.minify({ | ||
ecma: 8, | ||
ecma: 2017, | ||
safari10: true | ||
@@ -151,3 +151,3 @@ }) | ||
```sh | ||
terser --ecma 8 --safari10 ... | ||
terser --ecma 2017 --safari10 ... | ||
``` | ||
@@ -163,3 +163,3 @@ | ||
terserOptions: { | ||
ecma: 8, | ||
ecma: 2017, | ||
safari10: true | ||
@@ -166,0 +166,0 @@ } |
@@ -26,3 +26,3 @@ /** | ||
if (!processed) { | ||
processed = new Map(); | ||
processed = new WeakSet(); | ||
state.set("processed", processed); | ||
@@ -59,3 +59,3 @@ } | ||
const template = t.taggedTemplateExpression( | ||
identity, | ||
t.cloneNode(identity), | ||
t.templateLiteral( | ||
@@ -66,3 +66,3 @@ path.node.quasi.quasis, | ||
); | ||
processed.set(template, true); | ||
processed.add(template); | ||
@@ -78,3 +78,3 @@ // Install an inline cache at the callsite using the global variable: | ||
ident, | ||
t.assignmentExpression("=", ident, template) | ||
t.assignmentExpression("=", t.cloneNode(ident), template) | ||
); | ||
@@ -81,0 +81,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
38809
2