mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:08:13 +00:00
LibJS: Update order of parameters in our is_less_than implementation
This change updates the parameter order of the is_less_than function signature and calls to match accordingly with the spec (https://tc39.es/ecma262/#sec-islessthan)
This commit is contained in:
parent
4e21835e70
commit
3d99e83a86
3 changed files with 8 additions and 9 deletions
|
@ -183,15 +183,14 @@ ThrowCompletionOr<double> compare_array_elements(GlobalObject& global_object, Va
|
|||
auto* y_string = js_string(vm, TRY(y.to_string(global_object)));
|
||||
|
||||
// 7. Let xSmaller be ! IsLessThan(xString, yString, true).
|
||||
// FIXME: Update order of parameters in our is_less_than() impl.
|
||||
auto x_smaller = MUST(is_less_than(global_object, true, x_string, y_string));
|
||||
auto x_smaller = MUST(is_less_than(global_object, x_string, y_string, true));
|
||||
|
||||
// 8. If xSmaller is true, return -1𝔽.
|
||||
if (x_smaller == TriState::True)
|
||||
return -1;
|
||||
|
||||
// 9. Let ySmaller be ! IsLessThan(yString, xString, true).
|
||||
auto y_smaller = MUST(is_less_than(global_object, true, y_string, x_string));
|
||||
auto y_smaller = MUST(is_less_than(global_object, y_string, x_string, true));
|
||||
|
||||
// 10. If ySmaller is true, return 1𝔽.
|
||||
if (y_smaller == TriState::True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue