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

@babel/plugin-proposal-logical-assignment-operators

Package Overview
Dependencies
Maintainers
6
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/plugin-proposal-logical-assignment-operators - npm Package Compare versions

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

51

lib/index.js

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

function _helperPluginUtils() {
const data = require("@babel/helper-plugin-utils");
var data = require("@babel/helper-plugin-utils");
_helperPluginUtils = function () {
_helperPluginUtils = function _helperPluginUtils() {
return data;

@@ -20,5 +20,5 @@ };

function _pluginSyntaxLogicalAssignmentOperators() {
const data = _interopRequireDefault(require("@babel/plugin-syntax-logical-assignment-operators"));
var data = _interopRequireDefault(require("@babel/plugin-syntax-logical-assignment-operators"));
_pluginSyntaxLogicalAssignmentOperators = function () {
_pluginSyntaxLogicalAssignmentOperators = function _pluginSyntaxLogicalAssignmentOperators() {
return data;

@@ -31,5 +31,5 @@ };

function _core() {
const data = require("@babel/core");
var data = require("@babel/core");
_core = function () {
_core = function _core() {
return data;

@@ -43,3 +43,3 @@ };

var _default = (0, _helperPluginUtils().declare)(api => {
var _default = (0, _helperPluginUtils().declare)(function (api) {
api.assertVersion(7);

@@ -49,12 +49,8 @@ return {

visitor: {
AssignmentExpression(path) {
const {
node,
scope
} = path;
const {
operator,
left,
right
} = node;
AssignmentExpression: function AssignmentExpression(path) {
var node = path.node,
scope = path.scope;
var operator = node.operator,
left = node.left,
right = node.right;

@@ -65,11 +61,9 @@ if (operator !== "||=" && operator !== "&&=" && operator !== "??=") {

const lhs = _core().types.cloneNode(left);
var lhs = _core().types.cloneNode(left);
if (_core().types.isMemberExpression(left)) {
const {
object,
property,
computed
} = left;
const memo = scope.maybeGenerateMemoised(object);
var object = left.object,
property = left.property,
computed = left.computed;
var memo = scope.maybeGenerateMemoised(object);

@@ -82,7 +76,7 @@ if (memo) {

if (computed) {
const memo = scope.maybeGenerateMemoised(property);
var _memo = scope.maybeGenerateMemoised(property);
if (memo) {
left.property = memo;
lhs.property = _core().types.assignmentExpression("=", _core().types.cloneNode(memo), property);
if (_memo) {
left.property = _memo;
lhs.property = _core().types.assignmentExpression("=", _core().types.cloneNode(_memo), property);
}

@@ -94,3 +88,2 @@ }

}
}

@@ -97,0 +90,0 @@ };

{
"name": "@babel/plugin-proposal-logical-assignment-operators",
"version": "7.0.0-beta.43",
"version": "7.0.0-beta.44",
"description": "Transforms logical assignment operators into short-circuited assignments",

@@ -12,14 +12,14 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-logical-assignment-operators",

"dependencies": {
"@babel/helper-plugin-utils": "7.0.0-beta.43",
"@babel/plugin-syntax-logical-assignment-operators": "7.0.0-beta.43"
"@babel/helper-plugin-utils": "7.0.0-beta.44",
"@babel/plugin-syntax-logical-assignment-operators": "7.0.0-beta.44"
},
"peerDependencies": {
"@babel/core": "7.0.0-beta.43"
"@babel/core": "7.0.0-beta.44"
},
"devDependencies": {
"@babel/core": "7.0.0-beta.43",
"@babel/helper-plugin-test-runner": "7.0.0-beta.43",
"@babel/plugin-proposal-nullish-coalescing-operator": "7.0.0-beta.43",
"@babel/plugin-syntax-nullish-coalescing-operator": "7.0.0-beta.43"
"@babel/core": "7.0.0-beta.44",
"@babel/helper-plugin-test-runner": "7.0.0-beta.44",
"@babel/plugin-proposal-nullish-coalescing-operator": "7.0.0-beta.44",
"@babel/plugin-syntax-nullish-coalescing-operator": "7.0.0-beta.44"
}
}
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