mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-30 08:18:49 +00:00
LibJS: Replace for_each_bound_name with for_each_bound_identifier
Preparation before deleting for_each_bound_name.
This commit is contained in:
parent
608a730bd6
commit
348e43b36d
Notes:
sideshowbarker
2024-07-16 20:31:50 +09:00
Author: https://github.com/kalenikaliaksandr
Commit: 348e43b36d
Pull-request: https://github.com/SerenityOS/serenity/pull/20112
4 changed files with 64 additions and 47 deletions
|
@ -464,8 +464,9 @@ ThrowCompletionOr<void> SourceTextModule::initialize_environment(VM& vm)
|
|||
MUST(m_ecmascript_code->for_each_lexically_scoped_declaration([&](Declaration const& declaration) {
|
||||
// a. For each element dn of the BoundNames of d, do
|
||||
// NOTE: Due to the use of MUST with `create_immutable_binding`, `create_mutable_binding` and `initialize_binding` below,
|
||||
// an exception should not result from `for_each_bound_name`.
|
||||
MUST(declaration.for_each_bound_name([&](DeprecatedFlyString const& name) {
|
||||
// an exception should not result from `for_each_bound_identifier`.
|
||||
MUST(declaration.for_each_bound_identifier([&](auto const& identifier) {
|
||||
auto const& name = identifier.string();
|
||||
// i. If IsConstantDeclaration of d is true, then
|
||||
if (declaration.is_constant_declaration()) {
|
||||
// 1. Perform ! env.CreateImmutableBinding(dn, true).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue