summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2023-05-26 13:01:54 +0200
committerAndreas Kling <kling@serenityos.org>2023-05-26 17:52:51 +0200
commit0d4c7fa392e90973561485ac7ef4954e250edab6 (patch)
tree49d3a7c1a48eb3d516d70980f78bea532af1c2f5
parent360b8b166f34317c0767f4f37a9dae6e8a533d95 (diff)
downloadserenity-0d4c7fa392e90973561485ac7ef4954e250edab6.zip
LibJS/Bytecode: Make for..in iterate property names as string
Makes 107 new tests pass in test262. :^)
-rw-r--r--Userland/Libraries/LibJS/Bytecode/Op.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Bytecode/Op.cpp b/Userland/Libraries/LibJS/Bytecode/Op.cpp
index 46b63caa7a..61d64727da 100644
--- a/Userland/Libraries/LibJS/Bytecode/Op.cpp
+++ b/Userland/Libraries/LibJS/Bytecode/Op.cpp
@@ -981,7 +981,7 @@ ThrowCompletionOr<void> GetObjectPropertyIterator::execute_impl(Bytecode::Interp
result_object->define_direct_property(vm.names.done, JS::Value(false), default_attributes);
if (key.is_number())
- result_object->define_direct_property(vm.names.value, JS::Value(key.as_number()), default_attributes);
+ result_object->define_direct_property(vm.names.value, PrimitiveString::create(vm, TRY_OR_THROW_OOM(vm, String::number(key.as_number()))), default_attributes);
else if (key.is_string())
result_object->define_direct_property(vm.names.value, PrimitiveString::create(vm, key.as_string()), default_attributes);
else