From d667721b247bf47fc46618a1504becf6c2105c06 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Sat, 27 Jan 2024 15:28:03 +0000 Subject: [PATCH] LibJS: Skip object creation for BigInt and Symbol values in GetValue I'm not sure why these were omitted initially - works fine for other engines, e.g.: - https://codeberg.org/kiesel-js/kiesel/src/commit/d5aed64eff25bfecf5ec764e2febd7a8a596d4a2/src/types/language/value.zig#L1279-L1292 - https://github.com/WebKit/WebKit/blob/5792a94c10c278d6dc441828444b1a585f41553d/Source/JavaScriptCore/runtime/JSCJSValue.cpp#L180-L206 --- Userland/Libraries/LibJS/Runtime/Reference.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Userland/Libraries/LibJS/Runtime/Reference.cpp b/Userland/Libraries/LibJS/Runtime/Reference.cpp index 688eafc7ca..7279a55e76 100644 --- a/Userland/Libraries/LibJS/Runtime/Reference.cpp +++ b/Userland/Libraries/LibJS/Runtime/Reference.cpp @@ -122,6 +122,10 @@ ThrowCompletionOr Reference::get_value(VM& vm) const base_obj = realm.intrinsics().number_prototype(); else if (m_base_value.is_boolean()) base_obj = realm.intrinsics().boolean_prototype(); + else if (m_base_value.is_bigint()) + base_obj = realm.intrinsics().bigint_prototype(); + else if (m_base_value.is_symbol()) + base_obj = realm.intrinsics().symbol_prototype(); else base_obj = TRY(m_base_value.to_object(vm));