From 5e99a462c04fa38380a6aa961e423a21240fe81f Mon Sep 17 00:00:00 2001 From: pfg Date: Wed, 15 Jan 2025 14:05:16 -0800 Subject: [PATCH] Match node's error.stack behaviour --- Source/JavaScriptCore/runtime/ErrorInstance.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/JavaScriptCore/runtime/ErrorInstance.cpp b/Source/JavaScriptCore/runtime/ErrorInstance.cpp index e8d226ea9dc1f..e77be60ea99cf 100644 --- a/Source/JavaScriptCore/runtime/ErrorInstance.cpp +++ b/Source/JavaScriptCore/runtime/ErrorInstance.cpp @@ -281,7 +281,7 @@ String ErrorInstance::sanitizedNameString(JSGlobalObject* globalObject) } RETURN_IF_EXCEPTION(scope, {}); - if (!nameValue || !nameValue.isPrimitive()) + if (!nameValue || !nameValue.isPrimitive() || nameValue.isUndefined()) return "Error"_s; RELEASE_AND_RETURN(scope, nameValue.toWTFString(globalObject)); }