summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJamie Mansfield <jmansfield@cadixdev.org>2022-11-19 12:16:21 +0000
committerLinus Groh <mail@linusgroh.de>2022-11-19 14:23:28 +0000
commitf1b44120055ffb795b7dcdfcab591c5010770113 (patch)
tree6db68abe5ac61b1cd39e9b3f6829ab4309be01e3
parent34f27f76ecc099d7cbeb724a50b1d2841dd4b112 (diff)
downloadserenity-f1b44120055ffb795b7dcdfcab591c5010770113.zip
LibJS: Add missing assert to TypedArray.prototype.includes
-rw-r--r--Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp4
1 files changed, 3 insertions, 1 deletions
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.