mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-10 19:46:03 +00:00
LibJS: Add missing assert to TypedArray.prototype.indexOf
This commit is contained in:
parent
80d2d3812a
commit
70a4e4bd67
Notes:
sideshowbarker
2024-07-17 16:23:55 +09:00
Author: https://github.com/jamierocks
Commit: 70a4e4bd67
Pull-request: https://github.com/SerenityOS/serenity/pull/16117
Reviewed-by: https://github.com/linusg ✅
1 changed files with 3 additions and 1 deletions
|
@ -681,7 +681,9 @@ JS_DEFINE_NATIVE_FUNCTION(TypedArrayPrototype::index_of)
|
||||||
// 5. Let n be ? ToIntegerOrInfinity(fromIndex).
|
// 5. Let n be ? ToIntegerOrInfinity(fromIndex).
|
||||||
auto n = TRY(vm.argument(1).to_integer_or_infinity(vm));
|
auto n = TRY(vm.argument(1).to_integer_or_infinity(vm));
|
||||||
|
|
||||||
// FIXME: 6. Assert: If fromIndex is undefined, then n is 0.
|
// 6. Assert: If fromIndex is undefined, then n is 0.
|
||||||
|
if (vm.argument(1).is_undefined())
|
||||||
|
VERIFY(n == 0);
|
||||||
|
|
||||||
auto value_n = Value(n);
|
auto value_n = Value(n);
|
||||||
// 7. If n is +∞, return -1𝔽.
|
// 7. If n is +∞, return -1𝔽.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue