1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:47:46 +00:00

LibJS: Convert to_property_key() to ThrowCompletionOr

This commit is contained in:
Idan Horowitz 2021-10-16 22:20:23 +03:00 committed by Linus Groh
parent 1639ed7e0a
commit c488f5a59d
9 changed files with 42 additions and 73 deletions

View file

@ -1043,7 +1043,7 @@ Reference MemberExpression::to_reference(Interpreter& interpreter, GlobalObject&
if (interpreter.exception())
return {};
// 5. Let propertyKey be ? ToPropertyKey(propertyNameValue).
property_key = property_name_value.to_property_key(global_object);
property_key = TRY_OR_DISCARD(property_name_value.to_property_key(global_object));
} else {
// SuperProperty : super . IdentifierName
@ -1273,9 +1273,7 @@ ThrowCompletionOr<Value> ClassExpression::class_definition_evaluation(Interprete
if (auto* exception = interpreter.exception())
return throw_completion(exception->value());
auto property_key = key.to_property_key(global_object);
if (auto* exception = interpreter.exception())
return throw_completion(exception->value());
auto property_key = TRY(key.to_property_key(global_object));
auto& target = method.is_static() ? *class_constructor : class_prototype.as_object();
method_function.set_home_object(&target);
@ -1302,9 +1300,7 @@ ThrowCompletionOr<Value> ClassExpression::class_definition_evaluation(Interprete
if (auto* exception = interpreter.exception())
return throw_completion(exception->value());
auto property_key = key.to_property_key(global_object);
if (auto* exception = interpreter.exception())
return throw_completion(exception->value());
auto property_key = TRY(key.to_property_key(global_object));
ECMAScriptFunctionObject* initializer = nullptr;
if (field.initializer()) {