@babel/plugin-transform-parameters
Advanced tools
Comparing version 7.0.0-beta.38 to 7.0.0-beta.39
@@ -62,3 +62,3 @@ "use strict"; | ||
body.push(buildLooseDefaultParam({ | ||
ASSIGNMENT_IDENTIFIER: left.node, | ||
ASSIGNMENT_IDENTIFIER: _core.types.cloneNode(left.node), | ||
DEFAULT_VALUE: right.node, | ||
@@ -73,3 +73,3 @@ UNDEFINED: undefinedNode | ||
DEFAULT_VALUE: right.node, | ||
PARAMETER_NAME: paramName, | ||
PARAMETER_NAME: _core.types.cloneNode(paramName), | ||
UNDEFINED: undefinedNode | ||
@@ -110,3 +110,3 @@ })); | ||
body.push(_defNode2); | ||
param.replaceWith(uid); | ||
param.replaceWith(_core.types.cloneNode(uid)); | ||
} | ||
@@ -113,0 +113,0 @@ |
@@ -120,3 +120,3 @@ "use strict"; | ||
} else { | ||
index = _core.types.binaryExpression("+", path.parent.property, offsetLiteral); | ||
index = _core.types.binaryExpression("+", path.parent.property, _core.types.cloneNode(offsetLiteral)); | ||
} | ||
@@ -136,3 +136,3 @@ | ||
INDEX: index, | ||
REF: temp | ||
REF: _core.types.cloneNode(temp) | ||
})); | ||
@@ -197,13 +197,15 @@ } else { | ||
var clonedArgsId = _core.types.cloneNode(argsId); | ||
switch (cause) { | ||
case "indexGetter": | ||
optimiseIndexGetter(_path, argsId, state.offset); | ||
optimiseIndexGetter(_path, clonedArgsId, state.offset); | ||
break; | ||
case "lengthGetter": | ||
optimiseLengthGetter(_path, argsId, state.offset); | ||
optimiseLengthGetter(_path, clonedArgsId, state.offset); | ||
break; | ||
default: | ||
_path.replaceWith(argsId); | ||
_path.replaceWith(clonedArgsId); | ||
@@ -225,8 +227,10 @@ } | ||
var len = scope.generateUidIdentifier("len"); | ||
var arrKey = key; | ||
var arrLen = len; | ||
var arrKey, arrLen; | ||
if (node.params.length) { | ||
arrKey = _core.types.binaryExpression("-", key, start); | ||
arrLen = _core.types.conditionalExpression(_core.types.binaryExpression(">", len, start), _core.types.binaryExpression("-", len, start), _core.types.numericLiteral(0)); | ||
arrKey = _core.types.binaryExpression("-", _core.types.cloneNode(key), _core.types.cloneNode(start)); | ||
arrLen = _core.types.conditionalExpression(_core.types.binaryExpression(">", _core.types.cloneNode(len), _core.types.cloneNode(start)), _core.types.binaryExpression("-", _core.types.cloneNode(len), _core.types.cloneNode(start)), _core.types.numericLiteral(0)); | ||
} else { | ||
arrKey = _core.types.identifier(key.name); | ||
arrLen = _core.types.identifier(len.name); | ||
} | ||
@@ -233,0 +237,0 @@ |
{ | ||
"name": "@babel/plugin-transform-parameters", | ||
"version": "7.0.0-beta.38", | ||
"version": "7.0.0-beta.39", | ||
"description": "Compile ES2015 default and rest parameters to ES5", | ||
@@ -9,4 +9,4 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-parameters", | ||
"dependencies": { | ||
"@babel/helper-call-delegate": "7.0.0-beta.38", | ||
"@babel/helper-get-function-arity": "7.0.0-beta.38" | ||
"@babel/helper-call-delegate": "7.0.0-beta.39", | ||
"@babel/helper-get-function-arity": "7.0.0-beta.39" | ||
}, | ||
@@ -17,8 +17,8 @@ "keywords": [ | ||
"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
15528
346
+ 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-call-delegate@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/helper-hoist-variables@7.0.0-beta.39(transitive)
+ Added@babel/helpers@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-call-delegate@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/helper-hoist-variables@7.0.0-beta.38(transitive)
- Removed@babel/helpers@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)