From f1b44120055ffb795b7dcdfcab591c5010770113 Mon Sep 17 00:00:00 2001 From: Jamie Mansfield Date: Sat, 19 Nov 2022 12:16:21 +0000 Subject: [PATCH] LibJS: Add missing assert to TypedArray.prototype.includes --- Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp b/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp index f793898e22..1d4d9ef9d0 100644 --- a/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp @@ -618,7 +618,9 @@ JS_DEFINE_NATIVE_FUNCTION(TypedArrayPrototype::includes) // 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 false.