babel-plugin-minify-simplify
Advanced tools
Comparing version 0.3.0-alpha.a7421897 to 0.3.0-alpha.ab81368f
@@ -27,4 +27,3 @@ "use strict"; | ||
var _h$typeSymbols = h.typeSymbols(t), | ||
EX = _h$typeSymbols.Expression, | ||
LE = _h$typeSymbols.LogicalExpression; | ||
EX = _h$typeSymbols.Expression; | ||
@@ -36,10 +35,6 @@ // Convention: | ||
var matcher = new PatternMatch([[LE, true, false, function (e) { | ||
return e; | ||
}], [EX, true, false, function (e) { | ||
var matcher = new PatternMatch([[EX, true, false, function (e) { | ||
return notnot(e); | ||
}], [EX, false, true, function (e) { | ||
return not(e); | ||
}], [LE, true, EX, function (e, c, a) { | ||
return or(e, a); | ||
}], [EX, true, EX, function (e, c, a) { | ||
@@ -51,4 +46,2 @@ return or(notnot(e), a); | ||
return or(not(e), c); | ||
}], [LE, EX, false, function (e, c) { | ||
return and(e, c); | ||
}], [EX, EX, false, function (e, c) { | ||
@@ -55,0 +48,0 @@ return and(notnot(e), c); |
@@ -8,13 +8,16 @@ "use strict"; | ||
// Types as Symbols - for comparing types | ||
// init must be empty object - | ||
// computing this involves checking object.keys() to be of length 0 | ||
// skipped otherwise | ||
var types = {}; | ||
// This is a test key which is used to avoid Object.keys check | ||
// Object.keys() check is really expensive | ||
// https://gist.github.com/vigneshshanmugam/c766550ecd02292dcdfbf0bf013b9d3d | ||
var testKey = "Expression"; | ||
var typeSymbols = function typeSymbols(t) { | ||
// don't recompute | ||
if (Object.keys(types).length < 1) { | ||
t.TYPES.forEach(function (type) { | ||
types[type] = Symbol.for(type); | ||
}); | ||
if (types[testKey] !== undefined) { | ||
return types; | ||
} | ||
t.TYPES.forEach(function (type) { | ||
types[type] = Symbol.for(type); | ||
}); | ||
return types; | ||
@@ -21,0 +24,0 @@ }; |
@@ -502,12 +502,2 @@ "use strict"; | ||
node.body = statements; | ||
// this additional traversal is horrible but it's done to fix | ||
// https://github.com/babel/minify/issues/323 | ||
// in which type annotation somehow gets messed up | ||
// during sequence expression transformation | ||
path.traverse({ | ||
Identifier: function Identifier(path) { | ||
path.getTypeAnnotation(); | ||
} | ||
}); | ||
}, | ||
@@ -514,0 +504,0 @@ |
{ | ||
"name": "babel-plugin-minify-simplify", | ||
"version": "0.3.0-alpha.a7421897", | ||
"version": "0.3.0-alpha.ab81368f", | ||
"description": "", | ||
@@ -15,6 +15,6 @@ "keywords": [ | ||
"dependencies": { | ||
"babel-helper-flip-expressions": "^0.3.0-alpha.a7421897", | ||
"babel-helper-flip-expressions": "^0.3.0-alpha.ab81368f", | ||
"babel-helper-is-nodes-equiv": "^0.0.1", | ||
"babel-helper-to-multiple-sequence-expressions": "^0.3.0-alpha.a7421897" | ||
"babel-helper-to-multiple-sequence-expressions": "^0.3.0-alpha.ab81368f" | ||
} | ||
} |
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
62353
1618