1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 12:47:35 +00:00

LibJS: Add missing assert to TypedArray.prototype.indexOf

This commit is contained in:
Jamie Mansfield 2022-11-19 12:23:38 +00:00 committed by Linus Groh
parent 80d2d3812a
commit 70a4e4bd67

View file

@ -681,7 +681,9 @@ JS_DEFINE_NATIVE_FUNCTION(TypedArrayPrototype::index_of)
// 5. Let n be ? ToIntegerOrInfinity(fromIndex).
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);
// 7. If n is +∞, return -1𝔽.