1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 05:57:44 +00:00

LibJS: Propagate the OOM error from setting the String length property

This commit is contained in:
Timothy Flynn 2023-01-28 13:40:56 -05:00 committed by Linus Groh
parent b75b7f0c0d
commit 8414734a2d
4 changed files with 6 additions and 7 deletions

View file

@ -63,7 +63,7 @@ ThrowCompletionOr<NonnullGCPtr<Object>> StringConstructor::construct(FunctionObj
else
primitive_string = TRY(vm.argument(0).to_primitive_string(vm));
auto* prototype = TRY(get_prototype_from_constructor(vm, new_target, &Intrinsics::string_prototype));
return StringObject::create(realm, *primitive_string, *prototype);
return MUST_OR_THROW_OOM(StringObject::create(realm, *primitive_string, *prototype));
}
// 22.1.2.4 String.raw ( template, ...substitutions ), https://tc39.es/ecma262/#sec-string.raw