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

babel-plugin-transform-es2015-parameters

Package Overview
Dependencies
Maintainers
4
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-es2015-parameters - npm Package Compare versions

Comparing version 7.0.0-alpha.14 to 7.0.0-alpha.15

22

lib/rest.js

@@ -20,5 +20,5 @@ "use strict";

var restIndex = (0, _babelTemplate2.default)("\n ARGUMENTS.length <= INDEX ? undefined : ARGUMENTS[INDEX]\n");
var restIndex = (0, _babelTemplate2.default)("\n (INDEX < OFFSET || ARGUMENTS.length <= INDEX) ? undefined : ARGUMENTS[INDEX]\n");
var restIndexImpure = (0, _babelTemplate2.default)("\n REF = INDEX, ARGUMENTS.length <= REF ? undefined : ARGUMENTS[REF]\n");
var restIndexImpure = (0, _babelTemplate2.default)("\n REF = INDEX, (REF < OFFSET || ARGUMENTS.length <= REF) ? undefined : ARGUMENTS[REF]\n");

@@ -115,2 +115,3 @@ var restLength = (0, _babelTemplate2.default)("\n ARGUMENTS.length <= OFFSET ? 0 : ARGUMENTS.length - OFFSET\n");

function optimiseIndexGetter(path, argsId, offset) {
var offsetLiteral = t.numericLiteral(offset);
var index = void 0;

@@ -123,3 +124,3 @@

} else {
index = t.binaryExpression("+", path.parent.property, t.numericLiteral(offset));
index = t.binaryExpression("+", path.parent.property, offsetLiteral);
}

@@ -134,2 +135,3 @@

ARGUMENTS: argsId,
OFFSET: offsetLiteral,
INDEX: index,

@@ -139,6 +141,18 @@ REF: temp

} else {
path.parentPath.replaceWith(restIndex({
var parentPath = path.parentPath;
parentPath.replaceWith(restIndex({
ARGUMENTS: argsId,
OFFSET: offsetLiteral,
INDEX: index
}));
var offsetTestPath = parentPath.get("test").get("left");
var valRes = offsetTestPath.evaluate();
if (valRes.confident) {
if (valRes.value === true) {
parentPath.replaceWith(parentPath.scope.buildUndefinedNode());
} else {
parentPath.get("test").replaceWith(parentPath.get("test").get("right"));
}
}
}

@@ -145,0 +159,0 @@ }

14

package.json
{
"name": "babel-plugin-transform-es2015-parameters",
"version": "7.0.0-alpha.14",
"version": "7.0.0-alpha.15",
"description": "Compile ES2015 default and rest parameters to ES5",

@@ -9,7 +9,7 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-es2015-parameters",

"dependencies": {
"babel-helper-call-delegate": "7.0.0-alpha.14",
"babel-helper-get-function-arity": "7.0.0-alpha.14",
"babel-template": "7.0.0-alpha.14",
"babel-traverse": "7.0.0-alpha.14",
"babel-types": "7.0.0-alpha.14"
"babel-helper-call-delegate": "7.0.0-alpha.15",
"babel-helper-get-function-arity": "7.0.0-alpha.15",
"babel-template": "7.0.0-alpha.15",
"babel-traverse": "7.0.0-alpha.15",
"babel-types": "7.0.0-alpha.15"
},

@@ -20,4 +20,4 @@ "keywords": [

"devDependencies": {
"babel-helper-plugin-test-runner": "7.0.0-alpha.14"
"babel-helper-plugin-test-runner": "7.0.0-alpha.15"
}
}
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