pasika 0.10.78 → 0.10.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6262,6 +6262,10 @@ function scopeUsageMessage(sourceText, propertyNames) {
|
|
|
6262
6262
|
function hasBinding(context, node, name) {
|
|
6263
6263
|
const initialScope = context.sourceCode.getScope(node);
|
|
6264
6264
|
if (initialScope.variables.some((variable) => variable.name === name)) return true;
|
|
6265
|
+
const descendantHasBinding = (scope) => scope.childScopes.some(
|
|
6266
|
+
(childScope) => childScope.variables.some((variable) => variable.name === name) || descendantHasBinding(childScope)
|
|
6267
|
+
);
|
|
6268
|
+
if (descendantHasBinding(initialScope)) return true;
|
|
6265
6269
|
for (let scope = initialScope.upper; scope !== null; scope = scope.upper) {
|
|
6266
6270
|
if (scope.variables.some((variable) => variable.name === name)) return true;
|
|
6267
6271
|
}
|