mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:27:35 +00:00
LibJS: Convert make_super_property_reference to ThrowCompletionOr
This commit is contained in:
parent
9d7fe39640
commit
02a88c5063
3 changed files with 4 additions and 4 deletions
|
@ -776,7 +776,7 @@ Reference MemberExpression::to_reference(Interpreter& interpreter, GlobalObject&
|
||||||
bool strict = interpreter.vm().in_strict_mode();
|
bool strict = interpreter.vm().in_strict_mode();
|
||||||
|
|
||||||
// 7. Return ? MakeSuperPropertyReference(actualThis, propertyKey, strict).
|
// 7. Return ? MakeSuperPropertyReference(actualThis, propertyKey, strict).
|
||||||
return make_super_property_reference(global_object, actual_this, property_key, strict);
|
return TRY_OR_DISCARD(make_super_property_reference(global_object, actual_this, property_key, strict));
|
||||||
}
|
}
|
||||||
|
|
||||||
auto object_value = m_object->execute(interpreter, global_object);
|
auto object_value = m_object->execute(interpreter, global_object);
|
||||||
|
|
|
@ -389,7 +389,7 @@ Object* get_super_constructor(VM& vm)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 13.3.7.3 MakeSuperPropertyReference ( actualThis, propertyKey, strict ), https://tc39.es/ecma262/#sec-makesuperpropertyreference
|
// 13.3.7.3 MakeSuperPropertyReference ( actualThis, propertyKey, strict ), https://tc39.es/ecma262/#sec-makesuperpropertyreference
|
||||||
Reference make_super_property_reference(GlobalObject& global_object, Value actual_this, StringOrSymbol const& property_key, bool strict)
|
ThrowCompletionOr<Reference> make_super_property_reference(GlobalObject& global_object, Value actual_this, StringOrSymbol const& property_key, bool strict)
|
||||||
{
|
{
|
||||||
auto& vm = global_object.vm();
|
auto& vm = global_object.vm();
|
||||||
// 1. Let env be GetThisEnvironment().
|
// 1. Let env be GetThisEnvironment().
|
||||||
|
@ -399,7 +399,7 @@ Reference make_super_property_reference(GlobalObject& global_object, Value actua
|
||||||
// 3. Let baseValue be ? env.GetSuperBase().
|
// 3. Let baseValue be ? env.GetSuperBase().
|
||||||
auto base_value = env.get_super_base();
|
auto base_value = env.get_super_base();
|
||||||
// 4. Let bv be ? RequireObjectCoercible(baseValue).
|
// 4. Let bv be ? RequireObjectCoercible(baseValue).
|
||||||
auto bv = TRY_OR_DISCARD(require_object_coercible(global_object, base_value));
|
auto bv = TRY(require_object_coercible(global_object, base_value));
|
||||||
// 5. Return the Reference Record { [[Base]]: bv, [[ReferencedName]]: propertyKey, [[Strict]]: strict, [[ThisValue]]: actualThis }.
|
// 5. Return the Reference Record { [[Base]]: bv, [[ReferencedName]]: propertyKey, [[Strict]]: strict, [[ThisValue]]: actualThis }.
|
||||||
// 6. NOTE: This returns a Super Reference Record.
|
// 6. NOTE: This returns a Super Reference Record.
|
||||||
return Reference { bv, property_key, actual_this, strict };
|
return Reference { bv, property_key, actual_this, strict };
|
||||||
|
|
|
@ -18,7 +18,7 @@ DeclarativeEnvironment* new_declarative_environment(Environment&);
|
||||||
ObjectEnvironment* new_object_environment(Object&, bool is_with_environment, Environment*);
|
ObjectEnvironment* new_object_environment(Object&, bool is_with_environment, Environment*);
|
||||||
Environment& get_this_environment(VM&);
|
Environment& get_this_environment(VM&);
|
||||||
Object* get_super_constructor(VM&);
|
Object* get_super_constructor(VM&);
|
||||||
Reference make_super_property_reference(GlobalObject&, Value actual_this, StringOrSymbol const& property_key, bool strict);
|
ThrowCompletionOr<Reference> make_super_property_reference(GlobalObject&, Value actual_this, StringOrSymbol const& property_key, bool strict);
|
||||||
ThrowCompletionOr<Value> require_object_coercible(GlobalObject&, Value);
|
ThrowCompletionOr<Value> require_object_coercible(GlobalObject&, Value);
|
||||||
size_t length_of_array_like(GlobalObject&, Object const&);
|
size_t length_of_array_like(GlobalObject&, Object const&);
|
||||||
ThrowCompletionOr<MarkedValueList> create_list_from_array_like(GlobalObject&, Value, Function<ThrowCompletionOr<void>(Value)> = {});
|
ThrowCompletionOr<MarkedValueList> create_list_from_array_like(GlobalObject&, Value, Function<ThrowCompletionOr<void>(Value)> = {});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue