LibJS: Fix Vector<Value> => MarkedValueList in calendar_fields()

We need to ensure the temporary PrimitiveString cells don't get GC'd.
This commit is contained in:
Linus Groh 2021-08-07 23:13:16 +01:00
parent 53c44bea00
commit 5b12542d39
Notes: sideshowbarker 2024-07-18 07:13:47 +09:00

View file

@ -97,7 +97,7 @@ Vector<String> calendar_fields(GlobalObject& global_object, Object& calendar, Ve
return {};
// 2. Let fieldsArray be ! CreateArrayFromList(fieldNames).
Vector<Value> field_names_values;
auto field_names_values = MarkedValueList { vm.heap() };
for (auto& field_name : field_names)
field_names_values.append(js_string(vm, field_name));
Value fields_array = Array::create_from(global_object, field_names_values);