mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-20 16:28:54 +00:00
LibJS: Allow let
and const
to create locals in global code
This is actually safe everywhere but in the topmost program scope. For web compatibility reasons, we have to flush all top-level bindings to the environment, in case a subsequent separate <script> program comes looking for them.
This commit is contained in:
parent
0aa8cb7dac
commit
9d21d88374
Notes:
sideshowbarker
2024-07-17 03:00:02 +09:00
Author: https://github.com/awesomekling
Commit: 9d21d88374
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/165
2 changed files with 27 additions and 13 deletions
|
@ -96,7 +96,7 @@ public:
|
|||
};
|
||||
|
||||
NonnullRefPtr<VariableDeclaration const> parse_variable_declaration(IsForLoopVariableDeclaration is_for_loop_variable_declaration = IsForLoopVariableDeclaration::No);
|
||||
RefPtr<Identifier const> parse_lexical_binding();
|
||||
[[nodiscard]] RefPtr<Identifier const> parse_lexical_binding(Optional<DeclarationKind> = {});
|
||||
NonnullRefPtr<UsingDeclaration const> parse_using_declaration(IsForLoopVariableDeclaration is_for_loop_variable_declaration = IsForLoopVariableDeclaration::No);
|
||||
NonnullRefPtr<Statement const> parse_for_statement();
|
||||
|
||||
|
@ -347,7 +347,7 @@ private:
|
|||
}
|
||||
};
|
||||
|
||||
NonnullRefPtr<Identifier const> create_identifier_and_register_in_current_scope(SourceRange range, DeprecatedFlyString string);
|
||||
[[nodiscard]] NonnullRefPtr<Identifier const> create_identifier_and_register_in_current_scope(SourceRange range, DeprecatedFlyString string, Optional<DeclarationKind> = {});
|
||||
|
||||
NonnullRefPtr<SourceCode const> m_source_code;
|
||||
Vector<Position> m_rule_starts;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue