@babel/plugin-transform-block-scoping
Advanced tools
Comparing version 7.18.9 to 7.19.4
@@ -400,9 +400,16 @@ "use strict"; | ||
checkConstants() { | ||
const scope = this.scope; | ||
const state = this.state; | ||
const constBindings = new Map(); | ||
for (const name of Object.keys(scope.bindings)) { | ||
const binding = scope.bindings[name]; | ||
if (binding.kind !== "const") continue; | ||
for (const scope of new Set([this.scope, this.blockPath.scope])) { | ||
for (const name of Object.keys(scope.bindings)) { | ||
const binding = scope.bindings[name]; | ||
if (binding.kind === "const") constBindings.set(name, binding); | ||
} | ||
} | ||
const { | ||
state | ||
} = this; | ||
for (const [name, binding] of constBindings) { | ||
for (const violation of binding.constantViolations) { | ||
@@ -764,2 +771,4 @@ const readOnlyError = state.addHelper("readOnlyError"); | ||
} | ||
} | ||
//# sourceMappingURL=index.js.map |
@@ -97,2 +97,4 @@ "use strict"; | ||
}; | ||
exports.visitor = visitor; | ||
exports.visitor = visitor; | ||
//# sourceMappingURL=tdz.js.map |
{ | ||
"name": "@babel/plugin-transform-block-scoping", | ||
"version": "7.18.9", | ||
"version": "7.19.4", | ||
"description": "Compile ES2015 block scoping (const and let) to ES5", | ||
@@ -17,3 +17,3 @@ "repository": { | ||
"dependencies": { | ||
"@babel/helper-plugin-utils": "^7.18.9" | ||
"@babel/helper-plugin-utils": "^7.19.0" | ||
}, | ||
@@ -27,5 +27,5 @@ "keywords": [ | ||
"devDependencies": { | ||
"@babel/core": "^7.18.9", | ||
"@babel/core": "^7.19.3", | ||
"@babel/helper-plugin-test-runner": "^7.18.6", | ||
"@babel/traverse": "^7.18.9" | ||
"@babel/traverse": "^7.19.4" | ||
}, | ||
@@ -32,0 +32,0 @@ "engines": { |
94143
7
708