Explorar o código

LibJS: Do not store console table columns and rows in a plain vector

These values may contain Object types.
Timothy Flynn hai 8 meses
pai
achega
9949173fce
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      Userland/Libraries/LibJS/Console.cpp

+ 3 - 3
Userland/Libraries/LibJS/Console.cpp

@@ -143,7 +143,7 @@ ThrowCompletionOr<Value> Console::log()
 }
 }
 
 
 // To [create table row] given tabularDataItem, rowIndex, list finalColumns, and optional list properties, perform the following steps:
 // To [create table row] given tabularDataItem, rowIndex, list finalColumns, and optional list properties, perform the following steps:
-static ThrowCompletionOr<NonnullGCPtr<Object>> create_table_row(Realm& realm, Value row_index, Value tabular_data_item, Vector<Value>& final_columns, HashMap<PropertyKey, bool>& visited_columns, HashMap<PropertyKey, bool>& properties)
+static ThrowCompletionOr<NonnullGCPtr<Object>> create_table_row(Realm& realm, Value row_index, Value tabular_data_item, MarkedVector<Value>& final_columns, HashMap<PropertyKey, bool>& visited_columns, HashMap<PropertyKey, bool>& properties)
 {
 {
     auto& vm = realm.vm();
     auto& vm = realm.vm();
 
 
@@ -265,10 +265,10 @@ ThrowCompletionOr<Value> Console::table()
         }
         }
 
 
         // 1. Let `finalRows` be the new list, initially empty
         // 1. Let `finalRows` be the new list, initially empty
-        Vector<Value> final_rows;
+        MarkedVector<Value> final_rows(vm.heap());
 
 
         // 2. Let `finalColumns` be the new list, initially empty
         // 2. Let `finalColumns` be the new list, initially empty
-        Vector<Value> final_columns;
+        MarkedVector<Value> final_columns(vm.heap());
 
 
         HashMap<PropertyKey, bool> visited_columns;
         HashMap<PropertyKey, bool> visited_columns;