mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-15 12:23:15 +00:00
LibJS: Set internal function name of NativeError constructors
By using the same NativeFunction constructor as plain ErrorConstructor and passing the name, TypeError & co. will now include their name in backtraces and such. Eventually we should probably rely on [[InitialName]] for this, but for now that's how it works.
This commit is contained in:
parent
04bb17ca94
commit
ecba29c158
|
@ -64,7 +64,7 @@ ThrowCompletionOr<Object*> ErrorConstructor::construct(FunctionObject& new_targe
|
|||
|
||||
#define __JS_ENUMERATE(ClassName, snake_name, PrototypeName, ConstructorName, ArrayType) \
|
||||
ConstructorName::ConstructorName(GlobalObject& global_object) \
|
||||
: NativeFunction(*static_cast<Object*>(global_object.error_constructor())) \
|
||||
: NativeFunction(vm().names.ClassName.as_string(), *static_cast<Object*>(global_object.error_constructor())) \
|
||||
{ \
|
||||
} \
|
||||
\
|
||||
|
|
Loading…
Reference in a new issue