babel-helper-flip-expressions
Advanced tools
Comparing version 0.5.0-alpha.b5bafaeb to 0.5.0-alpha.e9f96ffe
"use strict"; | ||
var flipSeen = Symbol("flipSeen"); | ||
const flipSeen = Symbol("flipSeen"); | ||
@@ -13,4 +13,3 @@ module.exports = function (t) { | ||
// more nodes that could benifit from flipping than not. | ||
shouldFlip(topNode) { | ||
var savings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; | ||
shouldFlip(topNode, savings = 0) { | ||
visit(topNode); | ||
@@ -41,10 +40,10 @@ return savings > 0; | ||
flip(node, resultNotUsed) { | ||
var lastNodeDesc; | ||
var ret = visit(node); | ||
let lastNodeDesc; | ||
const ret = visit(node); | ||
ret[flipSeen] = true; | ||
if (resultNotUsed && lastNodeDesc) { | ||
var _lastNodeDesc = lastNodeDesc, | ||
parent = _lastNodeDesc.parent, | ||
key = _lastNodeDesc.key; | ||
const _lastNodeDesc = lastNodeDesc, | ||
parent = _lastNodeDesc.parent, | ||
key = _lastNodeDesc.key; | ||
@@ -80,3 +79,3 @@ if (parent && key && t.isUnaryExpression(parent[key], { | ||
if (t.isBinaryExpression(node)) { | ||
var operator; | ||
let operator; | ||
@@ -83,0 +82,0 @@ switch (node.operator) { |
{ | ||
"name": "babel-helper-flip-expressions", | ||
"version": "0.5.0-alpha.b5bafaeb", | ||
"version": "0.5.0-alpha.e9f96ffe", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
3001
86