mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:17:35 +00:00
LibJS: Skip lexical declaration traversal in FDI if there are none
This commit is contained in:
parent
3b6785245f
commit
aaa7b50f06
1 changed files with 23 additions and 21 deletions
|
@ -869,6 +869,7 @@ ThrowCompletionOr<void> ECMAScriptFunctionObject::function_declaration_instantia
|
||||||
// 33. Let lexDeclarations be the LexicallyScopedDeclarations of code.
|
// 33. Let lexDeclarations be the LexicallyScopedDeclarations of code.
|
||||||
// 34. For each element d of lexDeclarations, do
|
// 34. For each element d of lexDeclarations, do
|
||||||
// NOTE: Due to the use of MUST in the callback, an exception should not result from `for_each_lexically_scoped_declaration`.
|
// NOTE: Due to the use of MUST in the callback, an exception should not result from `for_each_lexically_scoped_declaration`.
|
||||||
|
if (scope_body->has_lexical_declarations()) {
|
||||||
MUST(scope_body->for_each_lexically_scoped_declaration([&](Declaration const& declaration) {
|
MUST(scope_body->for_each_lexically_scoped_declaration([&](Declaration const& declaration) {
|
||||||
// NOTE: Due to the use of MUST with `create_immutable_binding` and `create_mutable_binding` below,
|
// NOTE: Due to the use of MUST with `create_immutable_binding` and `create_mutable_binding` below,
|
||||||
// an exception should not result from `for_each_bound_name`.
|
// an exception should not result from `for_each_bound_name`.
|
||||||
|
@ -894,6 +895,7 @@ ThrowCompletionOr<void> ECMAScriptFunctionObject::function_declaration_instantia
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}));
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
// 35. Let privateEnv be the PrivateEnvironment of calleeContext.
|
// 35. Let privateEnv be the PrivateEnvironment of calleeContext.
|
||||||
auto private_environment = callee_context.private_environment;
|
auto private_environment = callee_context.private_environment;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue