babel-helper-mark-eval-scopes
Advanced tools
Comparing version 0.0.3 to 0.1.0
@@ -12,3 +12,3 @@ jest.autoMockOff(); | ||
plugins: [ | ||
function ({ traverse }) { | ||
function({ traverse }) { | ||
traverse.clearCache(); | ||
@@ -15,0 +15,0 @@ return { |
{ | ||
"name": "babel-helper-mark-eval-scopes", | ||
"version": "0.0.3", | ||
"version": "0.1.0", | ||
"description": "Mark scopes for deopt which contain a direct eval call", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/babel/babili#readme", |
@@ -10,7 +10,7 @@ "use strict"; | ||
isMarked, | ||
hasEval, | ||
hasEval | ||
}; | ||
function getEvalScopes(path) { | ||
const evalScopes = new Set; | ||
const evalScopes = new Set(); | ||
@@ -21,3 +21,3 @@ function add(scope) { | ||
evalScopes.add(evalScope); | ||
} while (evalScope = evalScope.parent); | ||
} while ((evalScope = evalScope.parent)); | ||
} | ||
@@ -29,3 +29,7 @@ | ||
if (callee.isIdentifier() && callee.node.name === "eval" && !callee.scope.getBinding("eval")) { | ||
if ( | ||
callee.isIdentifier() && | ||
callee.node.name === "eval" && | ||
!callee.scope.getBinding("eval") | ||
) { | ||
add(callee.scope); | ||
@@ -41,3 +45,3 @@ } | ||
const evalScopes = getEvalScopes(path); | ||
[...evalScopes].forEach((scope) => { | ||
[...evalScopes].forEach(scope => { | ||
scope[key] = true; | ||
@@ -44,0 +48,0 @@ }); |
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
4381
132