mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-19 07:22:21 +00:00
LibJS: Add missing CommonPropertyNames
s and StringMayBeNumber::No
s
This commit is contained in:
parent
cfb00ba494
commit
58631e9eef
Notes:
github-actions[bot]
2024-12-01 09:43:42 +00:00
Author: https://github.com/yyny
Commit: 58631e9eef
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2670
9 changed files with 27 additions and 19 deletions
|
@ -172,7 +172,7 @@ static ThrowCompletionOr<GC::Ref<Object>> create_table_row(Realm& realm, Value r
|
|||
|
||||
// 2. Set `row["(index)"]` to `rowIndex`
|
||||
{
|
||||
auto key = PropertyKey("(index)");
|
||||
auto key = PropertyKey { "(index)", PropertyKey::StringMayBeNumber::No };
|
||||
TRY(row->set(key, row_index, Object::ShouldThrowExceptions::No));
|
||||
|
||||
add_column(key);
|
||||
|
@ -228,12 +228,11 @@ static ThrowCompletionOr<GC::Ref<Object>> create_table_row(Realm& realm, Value r
|
|||
}
|
||||
// 5. Otherwise,
|
||||
else {
|
||||
PropertyKey key("Value");
|
||||
// 5.1. Set `row["Value"]` to `tabularDataItem`
|
||||
TRY(row->set(key, tabular_data_item, Object::ShouldThrowExceptions::No));
|
||||
TRY(row->set(vm.names.Value, tabular_data_item, Object::ShouldThrowExceptions::No));
|
||||
|
||||
// 5.2. If `finalColumns` does not contain "Value", append "Value" to `finalColumns`
|
||||
add_column(key);
|
||||
add_column(vm.names.Value);
|
||||
}
|
||||
|
||||
// 6. Return row
|
||||
|
@ -322,10 +321,10 @@ ThrowCompletionOr<Value> Console::table()
|
|||
auto final_data = Object::create(realm(), nullptr);
|
||||
|
||||
// 5.2. Set `finalData["rows"]` to `finalRows`
|
||||
TRY(final_data->set(PropertyKey("rows"), table_rows, Object::ShouldThrowExceptions::No));
|
||||
TRY(final_data->set(vm.names.rows, table_rows, Object::ShouldThrowExceptions::No));
|
||||
|
||||
// 5.3. Set finalData["columns"] to finalColumns
|
||||
TRY(final_data->set(PropertyKey("columns"), table_cols, Object::ShouldThrowExceptions::No));
|
||||
TRY(final_data->set(vm.names.columns, table_cols, Object::ShouldThrowExceptions::No));
|
||||
|
||||
// 5.4. Perform `Printer("table", finalData)`
|
||||
GC::MarkedVector<Value> args(vm.heap());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue