Socket
Socket
Sign inDemoInstall

@babel/helper-simple-access

Package Overview
Dependencies
16
Maintainers
5
Versions
71
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

14

lib/index.js

@@ -42,9 +42,15 @@ "use strict";

if (path.node.prefix || path.parentPath.isExpressionStatement() && !path.isCompletionRecord()) {
if (path.parentPath.isExpressionStatement() && !path.isCompletionRecord()) {
var operator = path.node.operator == "++" ? "+=" : "-=";
path.replaceWith(t().assignmentExpression(operator, arg.node, t().numericLiteral(1)));
} else if (path.node.prefix) {
path.replaceWith(t().assignmentExpression("=", t().identifier(localName), t().binaryExpression(path.node.operator[0], t().unaryExpression("+", arg.node), t().numericLiteral(1))));
} else {
var varName = path.scope.generateDeclaredUidIdentifier("old").name;
var binary = t().binaryExpression(path.node.operator.slice(0, 1), t().identifier(varName), t().numericLiteral(1));
path.replaceWith(t().sequenceExpression([t().assignmentExpression("=", t().identifier(varName), arg.node), t().assignmentExpression("=", t().cloneNode(arg.node), binary), t().identifier(varName)]));
var old = path.scope.generateUidIdentifierBasedOnNode(arg.node, "old");
var varName = old.name;
path.scope.push({
id: old
});
var binary = t().binaryExpression(path.node.operator[0], t().identifier(varName), t().numericLiteral(1));
path.replaceWith(t().sequenceExpression([t().assignmentExpression("=", t().identifier(varName), t().unaryExpression("+", arg.node)), t().assignmentExpression("=", t().cloneNode(arg.node), binary), t().identifier(varName)]));
}

@@ -51,0 +57,0 @@ }

{
"name": "@babel/helper-simple-access",
"version": "7.0.0-beta.44",
"version": "7.0.0-beta.45",
"description": "Babel helper for ensuring that access to a given value is performed through simple accesses",

@@ -11,6 +11,6 @@ "author": "Logan Smyth <loganfsmyth@gmail.com>",

"dependencies": {
"@babel/template": "7.0.0-beta.44",
"@babel/types": "7.0.0-beta.44",
"@babel/template": "7.0.0-beta.45",
"@babel/types": "7.0.0-beta.45",
"lodash": "^4.2.0"
}
}
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc