forked from quick-lint/quick-lint-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix crash when shadowing built-in globals
If an import (or other variable declaration) happens to shadow an automatically-declared global variable (such as NaN), quick-lint-js crashes: // JavaScript code: import { TextEncoder } from "util"; # quick-lint-js output: src/lint.cpp:503: internal check failed in report_error_if_variable_declaration_conflicts_in_scope: already_declared_variable->declaration.has_value() Fix the crash by putting user-declared global variables in a scope separate from automatically-declared global variables.
- Loading branch information
Showing
2 changed files
with
153 additions
and
80 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