@babel/plugin-proposal-object-rest-spread
Advanced tools
Comparing version 7.0.0-beta.38 to 7.0.0-beta.39
@@ -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" | ||
} | ||
} |
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
14408
273
+ Added@babel/code-frame@7.0.0-beta.39(transitive)
+ Added@babel/core@7.0.0-beta.39(transitive)
+ Added@babel/generator@7.0.0-beta.39(transitive)
+ Added@babel/helper-function-name@7.0.0-beta.39(transitive)
+ Added@babel/helper-get-function-arity@7.0.0-beta.39(transitive)
+ Added@babel/helpers@7.0.0-beta.39(transitive)
+ Added@babel/plugin-syntax-object-rest-spread@7.0.0-beta.39(transitive)
+ Added@babel/template@7.0.0-beta.39(transitive)
+ Added@babel/traverse@7.0.0-beta.39(transitive)
+ Added@babel/types@7.0.0-beta.39(transitive)
+ Addedbabylon@7.0.0-beta.39(transitive)
- Removed@babel/code-frame@7.0.0-beta.38(transitive)
- Removed@babel/core@7.0.0-beta.38(transitive)
- Removed@babel/generator@7.0.0-beta.38(transitive)
- Removed@babel/helper-function-name@7.0.0-beta.38(transitive)
- Removed@babel/helper-get-function-arity@7.0.0-beta.38(transitive)
- Removed@babel/helpers@7.0.0-beta.38(transitive)
- Removed@babel/plugin-syntax-object-rest-spread@7.0.0-beta.38(transitive)
- Removed@babel/template@7.0.0-beta.38(transitive)
- Removed@babel/traverse@7.0.0-beta.38(transitive)
- Removed@babel/types@7.0.0-beta.38(transitive)
- Removedbabylon@7.0.0-beta.38(transitive)
Updated@babel/plugin-syntax-object-rest-spread@7.0.0-beta.39