mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
LibJS: Add an else in StringPrototype::substr
No behavior change, but makes the code look more like the spec test for this function.
This commit is contained in:
parent
1b944b4c41
commit
db869a0402
Notes:
sideshowbarker
2024-07-17 22:55:25 +09:00
Author: https://github.com/nico Commit: https://github.com/SerenityOS/serenity/commit/db869a04022 Pull-request: https://github.com/SerenityOS/serenity/pull/11884
1 changed files with 1 additions and 1 deletions
|
@ -517,7 +517,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::substr)
|
|||
auto int_start = TRY(vm.argument(0).to_integer_or_infinity(global_object));
|
||||
if (Value(int_start).is_negative_infinity())
|
||||
int_start = 0;
|
||||
if (int_start < 0)
|
||||
else if (int_start < 0)
|
||||
int_start = max(size + int_start, 0);
|
||||
|
||||
auto length = vm.argument(1);
|
||||
|
|
Loading…
Reference in a new issue