|
@@ -25,7 +25,7 @@ ThrowCompletionOr<void> ErrorPrototype::initialize(Realm& realm)
|
|
|
MUST_OR_THROW_OOM(Base::initialize(realm));
|
|
|
u8 attr = Attribute::Writable | Attribute::Configurable;
|
|
|
define_direct_property(vm.names.name, PrimitiveString::create(vm, "Error"), attr);
|
|
|
- define_direct_property(vm.names.message, PrimitiveString::create(vm, ""), attr);
|
|
|
+ define_direct_property(vm.names.message, PrimitiveString::create(vm, String {}), attr);
|
|
|
define_native_function(realm, vm.names.toString, to_string, 0, attr);
|
|
|
// Non standard property "stack"
|
|
|
// Every other engine seems to have this in some way or another, and the spec
|
|
@@ -124,21 +124,21 @@ JS_DEFINE_NATIVE_FUNCTION(ErrorPrototype::stack_setter)
|
|
|
return TRY(this_object.create_data_property_or_throw(vm.names.stack, vm.argument(0)));
|
|
|
}
|
|
|
|
|
|
-#define __JS_ENUMERATE(ClassName, snake_name, PrototypeName, ConstructorName, ArrayType) \
|
|
|
- PrototypeName::PrototypeName(Realm& realm) \
|
|
|
- : PrototypeObject(*realm.intrinsics().error_prototype()) \
|
|
|
- { \
|
|
|
- } \
|
|
|
- \
|
|
|
- ThrowCompletionOr<void> PrototypeName::initialize(Realm& realm) \
|
|
|
- { \
|
|
|
- auto& vm = this->vm(); \
|
|
|
- MUST_OR_THROW_OOM(Base::initialize(realm)); \
|
|
|
- u8 attr = Attribute::Writable | Attribute::Configurable; \
|
|
|
- define_direct_property(vm.names.name, PrimitiveString::create(vm, #ClassName), attr); \
|
|
|
- define_direct_property(vm.names.message, PrimitiveString::create(vm, ""), attr); \
|
|
|
- \
|
|
|
- return {}; \
|
|
|
+#define __JS_ENUMERATE(ClassName, snake_name, PrototypeName, ConstructorName, ArrayType) \
|
|
|
+ PrototypeName::PrototypeName(Realm& realm) \
|
|
|
+ : PrototypeObject(*realm.intrinsics().error_prototype()) \
|
|
|
+ { \
|
|
|
+ } \
|
|
|
+ \
|
|
|
+ ThrowCompletionOr<void> PrototypeName::initialize(Realm& realm) \
|
|
|
+ { \
|
|
|
+ auto& vm = this->vm(); \
|
|
|
+ MUST_OR_THROW_OOM(Base::initialize(realm)); \
|
|
|
+ u8 attr = Attribute::Writable | Attribute::Configurable; \
|
|
|
+ define_direct_property(vm.names.name, PrimitiveString::create(vm, #ClassName), attr); \
|
|
|
+ define_direct_property(vm.names.message, PrimitiveString::create(vm, String {}), attr); \
|
|
|
+ \
|
|
|
+ return {}; \
|
|
|
}
|
|
|
|
|
|
JS_ENUMERATE_NATIVE_ERRORS
|