mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 00:31:14 +00:00
LibJS: Propagate "contains await" flag to parent scope in ScopePusher
The flag indicating the presence of an await expression should be passed up to the parent scope until the nearest function scope is reached. This resolves several problems related to identifying top-level awaits, which are currently not recognized correctly when used within a nested scope.
This commit is contained in:
parent
a627c15b07
commit
75ae368896
Notes:
sideshowbarker
2024-07-17 03:35:24 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/SerenityOS/serenity/commit/75ae368896 Pull-request: https://github.com/SerenityOS/serenity/pull/19797
|
@ -244,6 +244,7 @@ public:
|
|||
if (m_parent_scope && !m_function_parameters.has_value()) {
|
||||
m_parent_scope->m_contains_access_to_arguments_object |= m_contains_access_to_arguments_object;
|
||||
m_parent_scope->m_contains_direct_call_to_eval |= m_contains_direct_call_to_eval;
|
||||
m_parent_scope->m_contains_await_expression |= m_contains_await_expression;
|
||||
}
|
||||
|
||||
VERIFY(m_parser.m_state.current_scope_pusher == this);
|
||||
|
|
Loading…
Reference in a new issue