mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 21:18:14 +00:00
LibJS: Implement and use the InitializeBoundName AO
This commit is contained in:
parent
ca48151147
commit
df931e6a83
4 changed files with 28 additions and 13 deletions
|
@ -180,13 +180,7 @@ ThrowCompletionOr<void> VM::binding_initialization(FlyString const& target, Valu
|
|||
{
|
||||
// 1. Let name be StringValue of Identifier.
|
||||
// 2. Return ? InitializeBoundName(name, value, environment).
|
||||
// TODO: Use the right AO here
|
||||
if (environment) {
|
||||
MUST(environment->initialize_binding(global_object, target, value));
|
||||
return {};
|
||||
}
|
||||
auto reference = resolve_binding(target);
|
||||
return reference.put_value(global_object, value);
|
||||
return initialize_bound_name(global_object, target, value, environment);
|
||||
}
|
||||
|
||||
// 8.5.2 Runtime Semantics: BindingInitialization, https://tc39.es/ecma262/#sec-runtime-semantics-bindinginitialization
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue