Socket
Socket
Sign inDemoInstall

@babel/preset-modules

Package Overview
Dependencies
Maintainers
7
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/preset-modules - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

8

lib/plugins/transform-tagged-template-caching/index.js

@@ -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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc