Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@babel/plugin-transform-spread

Package Overview
Dependencies
Maintainers
5
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/plugin-transform-spread - npm Package Compare versions

Comparing version 7.0.0-beta.44 to 7.0.0-beta.45

22

lib/index.js

@@ -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"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc