@babel/plugin-proposal-object-rest-spread
Advanced tools
Comparing version 7.0.0-beta.47 to 7.0.0-beta.48
@@ -11,3 +11,3 @@ "use strict"; | ||
_helperPluginUtils = function _helperPluginUtils() { | ||
_helperPluginUtils = function () { | ||
return data; | ||
@@ -22,3 +22,3 @@ }; | ||
_pluginSyntaxObjectRestSpread = function _pluginSyntaxObjectRestSpread() { | ||
_pluginSyntaxObjectRestSpread = function () { | ||
return data; | ||
@@ -33,3 +33,3 @@ }; | ||
_core = function _core() { | ||
_core = function () { | ||
return data; | ||
@@ -45,6 +45,6 @@ }; | ||
api.assertVersion(7); | ||
const _opts$useBuiltIns = opts.useBuiltIns, | ||
useBuiltIns = _opts$useBuiltIns === void 0 ? false : _opts$useBuiltIns, | ||
_opts$loose = opts.loose, | ||
loose = _opts$loose === void 0 ? false : _opts$loose; | ||
const { | ||
useBuiltIns = false, | ||
loose = false | ||
} = opts; | ||
@@ -83,16 +83,3 @@ if (typeof loose !== "boolean") { | ||
function hasSpread(node) { | ||
for (var _iterator = node.properties, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { | ||
var _ref; | ||
if (_isArray) { | ||
if (_i >= _iterator.length) break; | ||
_ref = _iterator[_i++]; | ||
} else { | ||
_i = _iterator.next(); | ||
if (_i.done) break; | ||
_ref = _i.value; | ||
} | ||
const prop = _ref; | ||
for (const prop of node.properties) { | ||
if (_core().types.isSpreadElement(prop)) { | ||
@@ -111,16 +98,3 @@ return true; | ||
for (var _iterator2 = props, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { | ||
var _ref2; | ||
if (_isArray2) { | ||
if (_i2 >= _iterator2.length) break; | ||
_ref2 = _iterator2[_i2++]; | ||
} else { | ||
_i2 = _iterator2.next(); | ||
if (_i2.done) break; | ||
_ref2 = _i2.value; | ||
} | ||
const prop = _ref2; | ||
for (const prop of props) { | ||
if (_core().types.isIdentifier(prop.key) && !prop.computed) { | ||
@@ -145,15 +119,3 @@ keys.push(_core().types.stringLiteral(prop.key.name)); | ||
for (var _iterator3 = path.get("properties"), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { | ||
var _ref3; | ||
if (_isArray3) { | ||
if (_i3 >= _iterator3.length) break; | ||
_ref3 = _iterator3[_i3++]; | ||
} else { | ||
_i3 = _iterator3.next(); | ||
if (_i3.done) break; | ||
_ref3 = _i3.value; | ||
} | ||
const propPath = _ref3; | ||
for (const propPath of path.get("properties")) { | ||
const key = propPath.get("key"); | ||
@@ -184,7 +146,7 @@ | ||
const impureComputedPropertyDeclarators = replaceImpureComputedKeys(path); | ||
const { | ||
keys, | ||
allLiteral | ||
} = extractNormalizedKeys(path); | ||
const _extractNormalizedKey = extractNormalizedKeys(path), | ||
keys = _extractNormalizedKey.keys, | ||
allLiteral = _extractNormalizedKey.allLiteral; | ||
if (keys.length === 0) { | ||
@@ -279,8 +241,4 @@ return [impureComputedPropertyDeclarators, restElement.argument, _core().types.callExpression(getExtendsHelper(file), [_core().types.objectExpression([]), _core().types.cloneNode(objRef)])]; | ||
const objectPatternPath = path.findParent(path => path.isObjectPattern()); | ||
const [impureComputedPropertyDeclarators, argument, callExpression] = createObjectSpread(objectPatternPath, file, ref); | ||
const _createObjectSpread = createObjectSpread(objectPatternPath, file, ref), | ||
impureComputedPropertyDeclarators = _createObjectSpread[0], | ||
argument = _createObjectSpread[1], | ||
callExpression = _createObjectSpread[2]; | ||
_core().types.assertIdentifier(argument); | ||
@@ -326,8 +284,4 @@ | ||
nodes.push(_core().types.variableDeclaration("var", [_core().types.variableDeclarator(_core().types.identifier(refName), path.node.right)])); | ||
const [impureComputedPropertyDeclarators, argument, callExpression] = createObjectSpread(leftPath, file, _core().types.identifier(refName)); | ||
const _createObjectSpread2 = createObjectSpread(leftPath, file, _core().types.identifier(refName)), | ||
impureComputedPropertyDeclarators = _createObjectSpread2[0], | ||
argument = _createObjectSpread2[1], | ||
callExpression = _createObjectSpread2[2]; | ||
if (impureComputedPropertyDeclarators.length > 0) { | ||
@@ -348,4 +302,6 @@ nodes.push(_core().types.variableDeclaration("var", impureComputedPropertyDeclarators)); | ||
ForXStatement(path) { | ||
const node = path.node, | ||
scope = path.scope; | ||
const { | ||
node, | ||
scope | ||
} = path; | ||
const leftPath = path.get("left"); | ||
@@ -386,7 +342,3 @@ const left = node.left; | ||
var _arr = path.node.properties; | ||
for (var _i4 = 0; _i4 < _arr.length; _i4++) { | ||
const prop = _arr[_i4]; | ||
for (const prop of path.node.properties) { | ||
if (_core().types.isSpreadElement(prop)) { | ||
@@ -393,0 +345,0 @@ push(); |
{ | ||
"name": "@babel/plugin-proposal-object-rest-spread", | ||
"version": "7.0.0-beta.47", | ||
"version": "7.0.0-beta.48", | ||
"description": "Compile object rest and spread to ES5", | ||
@@ -12,12 +12,12 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-object-rest-spread", | ||
"dependencies": { | ||
"@babel/helper-plugin-utils": "7.0.0-beta.47", | ||
"@babel/plugin-syntax-object-rest-spread": "7.0.0-beta.47" | ||
"@babel/helper-plugin-utils": "7.0.0-beta.48", | ||
"@babel/plugin-syntax-object-rest-spread": "7.0.0-beta.48" | ||
}, | ||
"peerDependencies": { | ||
"@babel/core": "7.0.0-beta.47" | ||
"@babel/core": "7.0.0-beta.48" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "7.0.0-beta.47", | ||
"@babel/helper-plugin-test-runner": "7.0.0-beta.47" | ||
"@babel/core": "7.0.0-beta.48", | ||
"@babel/helper-plugin-test-runner": "7.0.0-beta.48" | ||
} | ||
} |
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
15110
280
+ Added@babel/code-frame@7.0.0-beta.48(transitive)
+ Added@babel/core@7.0.0-beta.48(transitive)
+ Added@babel/generator@7.0.0-beta.48(transitive)
+ Added@babel/helper-function-name@7.0.0-beta.48(transitive)
+ Added@babel/helper-get-function-arity@7.0.0-beta.48(transitive)
+ Added@babel/helper-plugin-utils@7.0.0-beta.48(transitive)
+ Added@babel/helper-split-export-declaration@7.0.0-beta.48(transitive)
+ Added@babel/helpers@7.0.0-beta.48(transitive)
+ Added@babel/highlight@7.0.0-beta.48(transitive)
+ Added@babel/parser@7.0.0-beta.48(transitive)
+ Added@babel/plugin-syntax-object-rest-spread@7.0.0-beta.48(transitive)
+ Added@babel/template@7.0.0-beta.48(transitive)
+ Added@babel/traverse@7.0.0-beta.48(transitive)
+ Added@babel/types@7.0.0-beta.48(transitive)
- Removed@babel/code-frame@7.0.0-beta.47(transitive)
- Removed@babel/core@7.0.0-beta.47(transitive)
- Removed@babel/generator@7.0.0-beta.47(transitive)
- Removed@babel/helper-function-name@7.0.0-beta.47(transitive)
- Removed@babel/helper-get-function-arity@7.0.0-beta.47(transitive)
- Removed@babel/helper-plugin-utils@7.0.0-beta.47(transitive)
- Removed@babel/helper-split-export-declaration@7.0.0-beta.47(transitive)
- Removed@babel/helpers@7.0.0-beta.47(transitive)
- Removed@babel/highlight@7.0.0-beta.47(transitive)
- Removed@babel/plugin-syntax-object-rest-spread@7.0.0-beta.47(transitive)
- Removed@babel/template@7.0.0-beta.47(transitive)
- Removed@babel/traverse@7.0.0-beta.47(transitive)
- Removed@babel/types@7.0.0-beta.47(transitive)
- Removedbabylon@7.0.0-beta.47(transitive)
Updated@babel/plugin-syntax-object-rest-spread@7.0.0-beta.48