@babel/plugin-transform-spread
Advanced tools
Comparing version 7.0.0-beta.44 to 7.0.0-beta.45
@@ -90,3 +90,3 @@ "use strict"; | ||
visitor: { | ||
ArrayExpression: function ArrayExpression(path, state) { | ||
ArrayExpression: function ArrayExpression(path) { | ||
var node = path.node, | ||
@@ -96,3 +96,3 @@ scope = path.scope; | ||
if (!hasSpread(elements)) return; | ||
var nodes = build(elements, scope, state); | ||
var nodes = build(elements, scope); | ||
var first = nodes.shift(); | ||
@@ -107,3 +107,3 @@ | ||
}, | ||
CallExpression: function CallExpression(path, state) { | ||
CallExpression: function CallExpression(path) { | ||
var node = path.node, | ||
@@ -122,3 +122,3 @@ scope = path.scope; | ||
} else { | ||
nodes = build(args, scope, state); | ||
nodes = build(args, scope); | ||
} | ||
@@ -157,3 +157,3 @@ | ||
}, | ||
NewExpression: function NewExpression(path, state) { | ||
NewExpression: function NewExpression(path) { | ||
var node = path.node, | ||
@@ -163,8 +163,12 @@ scope = path.scope; | ||
if (!hasSpread(args)) return; | ||
var nodes = build(args, scope, state); | ||
var nodes = build(args, scope); | ||
var first = nodes.shift(); | ||
var context = _core().types.arrayExpression([_core().types.nullLiteral()]); | ||
if (nodes.length) { | ||
args = _core().types.callExpression(_core().types.memberExpression(first, _core().types.identifier("concat")), nodes); | ||
} else { | ||
args = first; | ||
} | ||
args = _core().types.callExpression(_core().types.memberExpression(context, _core().types.identifier("concat")), nodes); | ||
path.replaceWith(_core().types.newExpression(_core().types.callExpression(_core().types.memberExpression(_core().types.memberExpression(_core().types.memberExpression(_core().types.identifier("Function"), _core().types.identifier("prototype")), _core().types.identifier("bind")), _core().types.identifier("apply")), [node.callee, args]), [])); | ||
path.replaceWith(_core().types.callExpression(path.hub.file.addHelper("construct"), [node.callee, args])); | ||
} | ||
@@ -171,0 +175,0 @@ } |
{ | ||
"name": "@babel/plugin-transform-spread", | ||
"version": "7.0.0-beta.44", | ||
"version": "7.0.0-beta.45", | ||
"description": "Compile ES2015 spread to ES5", | ||
@@ -12,11 +12,11 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-spread", | ||
"dependencies": { | ||
"@babel/helper-plugin-utils": "7.0.0-beta.44" | ||
"@babel/helper-plugin-utils": "7.0.0-beta.45" | ||
}, | ||
"peerDependencies": { | ||
"@babel/core": "7.0.0-beta.44" | ||
"@babel/core": "7.0.0-beta.45" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "7.0.0-beta.44", | ||
"@babel/helper-plugin-test-runner": "7.0.0-beta.44" | ||
"@babel/core": "7.0.0-beta.45", | ||
"@babel/helper-plugin-test-runner": "7.0.0-beta.45" | ||
} | ||
} |
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
139
6179
+ Added@babel/code-frame@7.0.0-beta.45(transitive)
+ Added@babel/core@7.0.0-beta.45(transitive)
+ Added@babel/generator@7.0.0-beta.45(transitive)
+ Added@babel/helper-function-name@7.0.0-beta.45(transitive)
+ Added@babel/helper-get-function-arity@7.0.0-beta.45(transitive)
+ Added@babel/helper-plugin-utils@7.0.0-beta.45(transitive)
+ Added@babel/helper-split-export-declaration@7.0.0-beta.45(transitive)
+ Added@babel/helpers@7.0.0-beta.45(transitive)
+ Added@babel/highlight@7.0.0-beta.45(transitive)
+ Added@babel/template@7.0.0-beta.45(transitive)
+ Added@babel/traverse@7.0.0-beta.45(transitive)
+ Added@babel/types@7.0.0-beta.45(transitive)
+ Addedbabylon@7.0.0-beta.45(transitive)
- Removed@babel/code-frame@7.0.0-beta.44(transitive)
- Removed@babel/core@7.0.0-beta.44(transitive)
- Removed@babel/generator@7.0.0-beta.44(transitive)
- Removed@babel/helper-function-name@7.0.0-beta.44(transitive)
- Removed@babel/helper-get-function-arity@7.0.0-beta.44(transitive)
- Removed@babel/helper-plugin-utils@7.0.0-beta.44(transitive)
- Removed@babel/helper-split-export-declaration@7.0.0-beta.44(transitive)
- Removed@babel/helpers@7.0.0-beta.44(transitive)
- Removed@babel/highlight@7.0.0-beta.44(transitive)
- Removed@babel/template@7.0.0-beta.44(transitive)
- Removed@babel/traverse@7.0.0-beta.44(transitive)
- Removed@babel/types@7.0.0-beta.44(transitive)
- Removedbabylon@7.0.0-beta.44(transitive)