You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 15, 2024. It is now read-only.
I'm working on trying to understand this codebase better.
But I can't understand why it works this way:
functiona(){}a();
To me it seems clear that the reference that's created as part of the call should resolve directly to the function declaration, but it's not - it remains as an unresolved reference that's added to the global scope's through list.
This would cause the no-unused-vars ESLint rule to error on the function declaration, were it not for this code in the linter.
It looks like it works seemingly by chance? ESLint augments the global scope with more variables, and then forcefully resolves any through references against the global variable set, which includes the function declaration as well as the augmented variables.
Is anyone able to explain why this works this way?
Or a better question - when closing the global scope, why doesn't it attempt to resolve all through references against the variables defined in the global scope?
The text was updated successfully, but these errors were encountered:
eslint-scope/tests/references.js
Lines 211 to 263 in dbddf14
I'm working on trying to understand this codebase better.
But I can't understand why it works this way:
To me it seems clear that the reference that's created as part of the call should resolve directly to the function declaration, but it's not - it remains as an unresolved reference that's added to the global scope's
through
list.This would cause the
no-unused-vars
ESLint rule to error on the function declaration, were it not for this code in the linter.It looks like it works seemingly by chance? ESLint augments the global scope with more variables, and then forcefully resolves any
through
references against the global variableset
, which includes the function declaration as well as the augmented variables.Is anyone able to explain why this works this way?
Or a better question - when closing the global scope, why doesn't it attempt to resolve all
through
references against the variables defined in the global scope?The text was updated successfully, but these errors were encountered: