From 6555248a047fc129bf8e331e633bdea934b35baa Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Fri, 30 Aug 2024 18:52:08 -0700 Subject: [PATCH] Make the V8_UNIMPLEMENTED error include the function name (#13559) Co-authored-by: 190n --- src/bun.js/bindings/v8/v8.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/bun.js/bindings/v8/v8.h b/src/bun.js/bindings/v8/v8.h index 461c653f51..d6c6e584c4 100644 --- a/src/bun.js/bindings/v8/v8.h +++ b/src/bun.js/bindings/v8/v8.h @@ -8,7 +8,15 @@ #define BUN_EXPORT JS_EXPORT #endif -#define V8_UNIMPLEMENTED() BUN_PANIC("You're using a module which calls a V8 function that Bun does not yet implement. Track progress at https://github.com/oven-sh/bun/issues/4290.") +#define V8_UNIMPLEMENTED() \ + do { \ + const auto str = WTF::makeString( \ + "You're using a module which calls a V8 function \""_s, \ + WTF::ASCIILiteral::fromLiteralUnsafe(__PRETTY_FUNCTION__), \ + "\" that Bun does not yet implement. Track progress at https://github.com/oven-sh/bun/issues/4290."_s); \ + auto utf8 = str.utf8(); \ + Bun__panic(utf8.data(), utf8.length()); \ + } while (0) extern "C" Zig::GlobalObject* Bun__getDefaultGlobalObject();