1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:58:11 +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:
Aliaksandr Kalenik 2023-07-20 16:40:14 +02:00 committed by Andreas Kling
parent 608a730bd6
commit 348e43b36d
4 changed files with 64 additions and 47 deletions

View file

@ -936,7 +936,9 @@ ThrowCompletionOr<void> eval_declaration_instantiation(VM& vm, Program const& pr
// Note: This is handled by for_each_var_scoped_variable_declaration.
// i. For each String vn of the BoundNames of d, do
return declaration.for_each_bound_name([&](auto const& name) -> ThrowCompletionOr<void> {
return declaration.for_each_bound_identifier([&](auto const& identifier) -> ThrowCompletionOr<void> {
auto const& name = identifier.string();
// 1. If vn is not an element of declaredFunctionNames, then
if (!declared_function_names.contains(name)) {
// a. If varEnv is a global Environment Record, then
@ -965,7 +967,9 @@ ThrowCompletionOr<void> eval_declaration_instantiation(VM& vm, Program const& pr
// a. NOTE: Lexically declared names are only instantiated here but not initialized.
// b. For each element dn of the BoundNames of d, do
return declaration.for_each_bound_name([&](auto const& name) -> ThrowCompletionOr<void> {
return declaration.for_each_bound_identifier([&](auto const& identifier) -> ThrowCompletionOr<void> {
auto const& name = identifier.string();
// i. If IsConstantDeclaration of d is true, then
if (declaration.is_constant_declaration()) {
// 1. Perform ? lexEnv.CreateImmutableBinding(dn, true).