1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:48:11 +00:00

LibJS: Convert Error's constructor and prototype to String

This commit is contained in:
Timothy Flynn 2023-02-16 14:21:09 -05:00 committed by Tim Flynn
parent 1400a85fae
commit f98d0acd27
2 changed files with 20 additions and 20 deletions

View file

@ -50,7 +50,7 @@ ThrowCompletionOr<NonnullGCPtr<Object>> ErrorConstructor::construct(FunctionObje
// 3. If message is not undefined, then
if (!message.is_undefined()) {
// a. Let msg be ? ToString(message).
auto msg = TRY(message.to_deprecated_string(vm));
auto msg = TRY(message.to_string(vm));
// b. Perform CreateNonEnumerableDataPropertyOrThrow(O, "message", msg).
error->create_non_enumerable_data_property_or_throw(vm.names.message, PrimitiveString::create(vm, move(msg)));
@ -105,7 +105,7 @@ ThrowCompletionOr<NonnullGCPtr<Object>> ErrorConstructor::construct(FunctionObje
/* 3. If message is not undefined, then */ \
if (!message.is_undefined()) { \
/* a. Let msg be ? ToString(message). */ \
auto msg = TRY(message.to_deprecated_string(vm)); \
auto msg = TRY(message.to_string(vm)); \
\
/* b. Perform CreateNonEnumerableDataPropertyOrThrow(O, "message", msg). */ \
error->create_non_enumerable_data_property_or_throw(vm.names.message, PrimitiveString::create(vm, move(msg))); \