babel-plugin-transform-object-rest-spread
Advanced tools
Comparing version 7.0.0-alpha.9 to 7.0.0-alpha.10
@@ -75,2 +75,10 @@ "use strict"; | ||
if (paramPath.isArrayPattern() && hasRestElement(paramPath)) { | ||
var elements = paramPath.get("elements"); | ||
for (var _i3 = 0; _i3 < elements.length; _i3++) { | ||
replaceRestElement(parentPath, elements[_i3], _i3, elements.length); | ||
} | ||
} | ||
if (paramPath.isObjectPattern() && hasRestElement(paramPath)) { | ||
@@ -118,6 +126,7 @@ var uid = parentPath.scope.generateUidIdentifier("ref"); | ||
var ref = this.originalPath.node.init; | ||
var refPropertyPath = []; | ||
path.findParent(function (path) { | ||
if (path.isObjectProperty()) { | ||
ref = t.memberExpression(ref, t.identifier(path.node.key.name)); | ||
refPropertyPath.unshift(path.node.key.name); | ||
} else if (path.isVariableDeclarator()) { | ||
@@ -128,2 +137,8 @@ return true; | ||
if (refPropertyPath.length) { | ||
refPropertyPath.forEach(function (prop) { | ||
ref = t.memberExpression(ref, t.identifier(prop)); | ||
}); | ||
} | ||
var _createObjectSpread = createObjectSpread(file, path.parentPath.node.properties, ref), | ||
@@ -242,12 +257,12 @@ argument = _createObjectSpread[0], | ||
for (var _iterator3 = path.node.properties, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { | ||
for (var _iterator3 = path.node.properties, _isArray3 = Array.isArray(_iterator3), _i4 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { | ||
var _ref4; | ||
if (_isArray3) { | ||
if (_i3 >= _iterator3.length) break; | ||
_ref4 = _iterator3[_i3++]; | ||
if (_i4 >= _iterator3.length) break; | ||
_ref4 = _iterator3[_i4++]; | ||
} else { | ||
_i3 = _iterator3.next(); | ||
if (_i3.done) break; | ||
_ref4 = _i3.value; | ||
_i4 = _iterator3.next(); | ||
if (_i4.done) break; | ||
_ref4 = _i4.value; | ||
} | ||
@@ -254,0 +269,0 @@ |
{ | ||
"name": "babel-plugin-transform-object-rest-spread", | ||
"version": "7.0.0-alpha.9", | ||
"version": "7.0.0-alpha.10", | ||
"description": "Compile object rest and spread to ES5", | ||
@@ -15,4 +15,4 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-object-rest-spread", | ||
"devDependencies": { | ||
"babel-helper-plugin-test-runner": "7.0.0-alpha.9" | ||
"babel-helper-plugin-test-runner": "7.0.0-alpha.10" | ||
} | ||
} |
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
11541
226