diff options
author | Jamie Mansfield <jmansfield@cadixdev.org> | 2022-11-19 12:23:38 +0000 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-11-19 14:23:28 +0000 |
commit | 70a4e4bd670d688a80efdf62d4b0f0502b61e9d4 (patch) | |
tree | 8e91de2953ebbdb54bcfeef2e744314340c1ca59 /Userland | |
parent | 80d2d3812a70e2e5d34d759d7dc529bd0fd5644a (diff) | |
download | serenity-70a4e4bd670d688a80efdf62d4b0f0502b61e9d4.zip |
LibJS: Add missing assert to TypedArray.prototype.indexOf
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp b/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp index 1d5e151df1..61e9b04e8e 100644 --- a/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp @@ -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𝔽. |