Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[[FIX]] Account for hoisting of importing bindings
Bindings created via ES2015 `import` declarations are "hoisted" during module instantiation. This enables reference prior to declaration, though JSHint previously reported an error for such cases. Remove the restriction by introducing a new binding type, "import", that is interpreted as hoisted and (unlike the existing "function" type) immutable. Extend the enforcement of the "latedef" linting option (which previously only concerned function declarations) to warn about imported bindings referenced prior to declaration. Although this a new warning, it is backwards-compatible because it only occurs in situations that were previously reported as errors.
- Loading branch information
1 parent
1854e68
commit bd36953
Showing
6 changed files
with
29 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters