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

LibJS: Remove implicit wrapping/unwrapping of completion records

This is an editorial change in the ECMA-262 spec, with similar changes
in some proposals.

See:
- 7575f74
- df899eb
- 9eb5a12
- c81f527
This commit is contained in:
Linus Groh 2022-05-02 20:54:39 +02:00
parent 15f32379bb
commit 9f3f3b0864
88 changed files with 792 additions and 735 deletions

View file

@ -51,8 +51,8 @@ ThrowCompletionOr<Object*> ErrorConstructor::construct(FunctionObject& new_targe
// a. Let msg be ? ToString(message).
auto msg = TRY(message.to_string(global_object));
// b. Perform ! CreateNonEnumerableDataPropertyOrThrow(O, "message", msg).
MUST(error->create_non_enumerable_data_property_or_throw(vm.names.message, js_string(vm, move(msg))));
// b. Perform CreateNonEnumerableDataPropertyOrThrow(O, "message", msg).
error->create_non_enumerable_data_property_or_throw(vm.names.message, js_string(vm, move(msg)));
}
// 4. Perform ? InstallErrorCause(O, options).
@ -79,7 +79,7 @@ ThrowCompletionOr<Object*> ErrorConstructor::construct(FunctionObject& new_targe
define_direct_property(vm.names.length, Value(1), Attribute::Configurable); \
} \
\
ConstructorName::~ConstructorName() { } \
ConstructorName::~ConstructorName() = default; \
\
/* 20.5.6.1.1 NativeError ( message [ , options ] ), https://tc39.es/ecma262/#sec-nativeerror */ \
ThrowCompletionOr<Value> ConstructorName::call() \
@ -105,8 +105,8 @@ ThrowCompletionOr<Object*> ErrorConstructor::construct(FunctionObject& new_targe
/* a. Let msg be ? ToString(message). */ \
auto msg = TRY(message.to_string(global_object)); \
\
/* b. Perform ! CreateNonEnumerableDataPropertyOrThrow(O, "message", msg). */ \
MUST(error->create_non_enumerable_data_property_or_throw(vm.names.message, js_string(vm, move(msg)))); \
/* b. Perform CreateNonEnumerableDataPropertyOrThrow(O, "message", msg). */ \
error->create_non_enumerable_data_property_or_throw(vm.names.message, js_string(vm, move(msg))); \
} \
\
/* 4. Perform ? InstallErrorCause(O, options). */ \