mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 06:58:11 +00:00
LibJS: Remove a few superfluous exception checks
We don't need to check for exceptions when defining properties on an array we literally created ourselves a few lines earlier.
This commit is contained in:
parent
7596ae4596
commit
7241b9ca0c
3 changed files with 1 additions and 16 deletions
|
@ -195,11 +195,7 @@ Value Object::get_own_properties(const Object& this_object, GetOwnPropertyReturn
|
|||
} else {
|
||||
auto* entry_array = Array::create(global_object());
|
||||
entry_array->define_property(0, js_string(interpreter(), String::number(i)));
|
||||
if (interpreter().exception())
|
||||
return {};
|
||||
entry_array->define_property(1, js_string(interpreter(), String::format("%c", str[i])));
|
||||
if (interpreter().exception())
|
||||
return {};
|
||||
properties_array->define_property(i, entry_array);
|
||||
}
|
||||
if (interpreter().exception())
|
||||
|
@ -222,11 +218,7 @@ Value Object::get_own_properties(const Object& this_object, GetOwnPropertyReturn
|
|||
} else {
|
||||
auto* entry_array = Array::create(global_object());
|
||||
entry_array->define_property(0, js_string(interpreter(), String::number(entry.index())));
|
||||
if (interpreter().exception())
|
||||
return {};
|
||||
entry_array->define_property(1, value_and_attributes.value);
|
||||
if (interpreter().exception())
|
||||
return {};
|
||||
properties_array->define_property(property_index, entry_array);
|
||||
}
|
||||
if (interpreter().exception())
|
||||
|
@ -251,11 +243,7 @@ Value Object::get_own_properties(const Object& this_object, GetOwnPropertyReturn
|
|||
} else {
|
||||
auto* entry_array = Array::create(global_object());
|
||||
entry_array->define_property(0, it.key.to_value(interpreter()));
|
||||
if (interpreter().exception())
|
||||
return {};
|
||||
entry_array->define_property(1, this_object.get(it.key));
|
||||
if (interpreter().exception())
|
||||
return {};
|
||||
properties_array->define_property(property_index, entry_array);
|
||||
}
|
||||
if (interpreter().exception())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue