Socket
Socket
Sign inDemoInstall

@babel/plugin-proposal-object-rest-spread

Package Overview
Dependencies
Maintainers
6
Versions
86
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/plugin-proposal-object-rest-spread - npm Package Compare versions

Comparing version 7.0.0-beta.38 to 7.0.0-beta.39

40

lib/index.js

@@ -78,3 +78,3 @@ "use strict";

} else {
keys.push(_prop2.key);
keys.push(_core.types.cloneNode(_prop2.key));
allLiteral = false;

@@ -110,8 +110,8 @@ }

if (_propPath.node.computed && !key.isPure()) {
var identifier = path.scope.generateUidIdentifierBasedOnNode(key.node);
var name = path.scope.generateUidBasedOnNode(key.node);
var declarator = _core.types.variableDeclarator(identifier, key.node);
var declarator = _core.types.variableDeclarator(_core.types.identifier(name), key.node);
impureComputedPropertyDeclarators.push(declarator);
key.replaceWith(identifier);
key.replaceWith(_core.types.identifier(name));
}

@@ -129,3 +129,3 @@ }

var restElement = _core.types.clone(last.node);
var restElement = _core.types.cloneNode(last.node);

@@ -147,3 +147,3 @@ last.remove();

return [impureComputedPropertyDeclarators, restElement.argument, _core.types.callExpression(file.addHelper("objectWithoutProperties"), [objRef, keyExpression])];
return [impureComputedPropertyDeclarators, restElement.argument, _core.types.callExpression(file.addHelper("objectWithoutProperties"), [_core.types.cloneNode(objRef), keyExpression])];
}

@@ -172,3 +172,3 @@

parentPath.get("body").unshiftContainer("body", declar);
paramPath.replaceWith(uid);
paramPath.replaceWith(_core.types.cloneNode(uid));
}

@@ -202,3 +202,3 @@ }

this.originalPath.insertBefore(_core.types.variableDeclarator(initRef, this.originalPath.node.init));
this.originalPath.replaceWith(_core.types.variableDeclarator(this.originalPath.node.id, initRef));
this.originalPath.replaceWith(_core.types.variableDeclarator(this.originalPath.node.id, _core.types.cloneNode(initRef)));
return;

@@ -255,5 +255,3 @@ }

for (var name in path.getOuterBindingIdentifiers(path)) {
var id = _core.types.identifier(name);
specifiers.push(_core.types.exportSpecifier(id, id));
specifiers.push(_core.types.exportSpecifier(_core.types.identifier(name), _core.types.identifier(name)));
}

@@ -273,6 +271,6 @@

var nodes = [];
var ref = path.scope.generateUidIdentifierBasedOnNode(path.node.right, "ref");
nodes.push(_core.types.variableDeclaration("var", [_core.types.variableDeclarator(ref, path.node.right)]));
var refName = path.scope.generateUidBasedOnNode(path.node.right, "ref");
nodes.push(_core.types.variableDeclaration("var", [_core.types.variableDeclarator(_core.types.identifier(refName), path.node.right)]));
var _createObjectSpread2 = createObjectSpread(leftPath, file, ref),
var _createObjectSpread2 = createObjectSpread(leftPath, file, _core.types.identifier(refName)),
impureComputedPropertyDeclarators = _createObjectSpread2[0],

@@ -286,12 +284,8 @@ argument = _createObjectSpread2[1],

var nodeWithoutSpread = _core.types.clone(path.node);
var nodeWithoutSpread = _core.types.cloneNode(path.node);
nodeWithoutSpread.right = ref;
nodeWithoutSpread.right = _core.types.identifier(refName);
nodes.push(_core.types.expressionStatement(nodeWithoutSpread));
nodes.push(_core.types.toStatement(_core.types.assignmentExpression("=", argument, callExpression)));
if (ref) {
nodes.push(_core.types.expressionStatement(ref));
}
nodes.push(_core.types.expressionStatement(_core.types.identifier(refName)));
path.replaceWithMultiple(nodes);

@@ -310,3 +304,3 @@ }

path.ensureBlock();
node.body.body.unshift(_core.types.variableDeclaration("var", [_core.types.variableDeclarator(left, temp)]));
node.body.body.unshift(_core.types.variableDeclaration("var", [_core.types.variableDeclarator(left, _core.types.cloneNode(temp))]));
return;

@@ -321,3 +315,3 @@ }

path.ensureBlock();
node.body.body.unshift(_core.types.variableDeclaration(node.left.kind, [_core.types.variableDeclarator(pattern, key)]));
node.body.body.unshift(_core.types.variableDeclaration(node.left.kind, [_core.types.variableDeclarator(pattern, _core.types.cloneNode(key))]));
},

@@ -324,0 +318,0 @@ ObjectExpression: function ObjectExpression(path, file) {

{
"name": "@babel/plugin-proposal-object-rest-spread",
"version": "7.0.0-beta.38",
"version": "7.0.0-beta.39",
"description": "Compile object rest and spread to ES5",

@@ -12,11 +12,11 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-object-rest-spread",

"dependencies": {
"@babel/plugin-syntax-object-rest-spread": "7.0.0-beta.38"
"@babel/plugin-syntax-object-rest-spread": "7.0.0-beta.39"
},
"peerDependencies": {
"@babel/core": "7.0.0-beta.38"
"@babel/core": "7.0.0-beta.39"
},
"devDependencies": {
"@babel/core": "7.0.0-beta.38",
"@babel/helper-plugin-test-runner": "7.0.0-beta.38"
"@babel/core": "7.0.0-beta.39",
"@babel/helper-plugin-test-runner": "7.0.0-beta.39"
}
}
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