@babel/plugin-proposal-logical-assignment-operators
Advanced tools
Comparing version 7.0.0-beta.43 to 7.0.0-beta.44
@@ -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" | ||
} | ||
} |
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
4137
64
+ Added@babel/code-frame@7.0.0-beta.44(transitive)
+ Added@babel/core@7.0.0-beta.44(transitive)
+ Added@babel/generator@7.0.0-beta.44(transitive)
+ Added@babel/helper-function-name@7.0.0-beta.44(transitive)
+ Added@babel/helper-get-function-arity@7.0.0-beta.44(transitive)
+ Added@babel/helper-plugin-utils@7.0.0-beta.44(transitive)
+ Added@babel/helper-split-export-declaration@7.0.0-beta.44(transitive)
+ Added@babel/helpers@7.0.0-beta.44(transitive)
+ Added@babel/highlight@7.0.0-beta.44(transitive)
+ Added@babel/plugin-syntax-logical-assignment-operators@7.0.0-beta.44(transitive)
+ Added@babel/template@7.0.0-beta.44(transitive)
+ Added@babel/traverse@7.0.0-beta.44(transitive)
+ Added@babel/types@7.0.0-beta.44(transitive)
+ Addedbabylon@7.0.0-beta.44(transitive)
- Removed@babel/code-frame@7.0.0-beta.43(transitive)
- Removed@babel/core@7.0.0-beta.43(transitive)
- Removed@babel/generator@7.0.0-beta.43(transitive)
- Removed@babel/helper-function-name@7.0.0-beta.43(transitive)
- Removed@babel/helper-get-function-arity@7.0.0-beta.43(transitive)
- Removed@babel/helper-plugin-utils@7.0.0-beta.43(transitive)
- Removed@babel/helper-split-export-declaration@7.0.0-beta.43(transitive)
- Removed@babel/helpers@7.0.0-beta.43(transitive)
- Removed@babel/highlight@7.0.0-beta.43(transitive)
- Removed@babel/plugin-syntax-logical-assignment-operators@7.0.0-beta.43(transitive)
- Removed@babel/template@7.0.0-beta.43(transitive)
- Removed@babel/traverse@7.0.0-beta.43(transitive)
- Removed@babel/types@7.0.0-beta.43(transitive)
- Removedbabylon@7.0.0-beta.43(transitive)
Updated@babel/plugin-syntax-logical-assignment-operators@7.0.0-beta.44