summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2022-03-15 14:08:10 +0000
committerAndreas Kling <kling@serenityos.org>2022-03-15 17:32:48 +0100
commitecba29c158c1ae916fa59141ec50635f278c30e0 (patch)
tree44eebdbe16c4d32fc44675be7b03c9b95429f91c /Userland/Libraries/LibJS
parent04bb17ca94f5537a29e5d7996970cabf6410a51d (diff)
downloadserenity-ecba29c158c1ae916fa59141ec50635f278c30e0.zip
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.
Diffstat (limited to 'Userland/Libraries/LibJS')
-rw-r--r--Userland/Libraries/LibJS/Runtime/ErrorConstructor.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/ErrorConstructor.cpp b/Userland/Libraries/LibJS/Runtime/ErrorConstructor.cpp
index 9f6b879513..5b6da08c72 100644
--- a/Userland/Libraries/LibJS/Runtime/ErrorConstructor.cpp
+++ b/Userland/Libraries/LibJS/Runtime/ErrorConstructor.cpp
@@ -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())) \
{ \
} \
\