mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
LibJS: Convert Error's constructor and prototype to String
This commit is contained in:
@@ -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))); \
|
||||
|
||||
Reference in New Issue
Block a user