-
-
Notifications
You must be signed in to change notification settings - Fork 471
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(ast)!: rename
is_strict
methods to `has_use_strict_directi…
…ve` (#7783) The name `is_strict` was misleading for these methods, because it doesn't tell you if the e.g. function *is* strict mode, only whether it contains a `"use strict"` directive. `Function::is_strict` might return `false` for a function which does have strict mode semantics because it's e.g. in an ESM file. Rename these methods to `has_use_strict_directive` to better reflect what they do. For `Program`, change the method to only check for `"use strict"` directive and not to look at `source_type`. `Semantic` should be the source of truth on strict/sloppy mode of AST nodes. It's cheaper to look up the `ScopeFlags` than to iterate over `directives`, so don't encourage this anti-pattern by providing a "rival" method.
- Loading branch information
1 parent
bde753b
commit 96a26d3
Showing
7 changed files
with
23 additions
and
28 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
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