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.:

- d5aed64eff/src/types/language/value.zig (L1279-L1292)
- 5792a94c10/Source/JavaScriptCore/runtime/JSCJSValue.cpp (L180-L206)
This commit is contained in:
Linus Groh 2024-01-27 15:28:03 +00:00 committed by Tim Flynn
parent 5cf1570f40
commit d667721b24

View file

@ -122,6 +122,10 @@ ThrowCompletionOr<Value> 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));