babel-plugin-transform-es2015-typeof-symbol
Advanced tools
Comparing version 6.0.15 to 6.1.2
"use strict"; | ||
var _Symbol = require("babel-runtime/core-js/symbol")["default"]; | ||
exports.__esModule = true; | ||
@@ -8,2 +10,4 @@ | ||
var IGNORE = _Symbol(); | ||
return { | ||
@@ -15,3 +19,6 @@ visitor: { | ||
if (node._ignoreSpecSymbols) return; | ||
if (node[IGNORE]) return; | ||
if (path.find(function (path) { | ||
return !!path.node._generated; | ||
})) return; | ||
@@ -31,3 +38,3 @@ if (path.parentPath.isBinaryExpression() && t.EQUALITY_BINARY_OPERATORS.indexOf(parent.operator) >= 0) { | ||
var unary = t.unaryExpression("typeof", node.argument); | ||
unary._ignoreSpecSymbols = true; | ||
unary[IGNORE] = true; | ||
path.replaceWith(t.conditionalExpression(t.binaryExpression("===", unary, undefLiteral), undefLiteral, call)); | ||
@@ -38,14 +45,2 @@ } else { | ||
} | ||
}, | ||
BinaryExpression: function BinaryExpression(path) { | ||
var node = path.node; | ||
if (node.operator === "instanceof") { | ||
path.replaceWith(t.callExpression(this.addHelper("instanceof"), [node.left, node.right])); | ||
} | ||
}, | ||
"VariableDeclaration|FunctionDeclaration": function VariableDeclarationFunctionDeclaration(path) { | ||
if (path.node._generated) path.skip(); | ||
} | ||
@@ -52,0 +47,0 @@ } |
{ | ||
"name": "babel-plugin-transform-es2015-typeof-symbol", | ||
"version": "6.0.15", | ||
"version": "6.1.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-es2015-typeof-symbol", |
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
2353
37