From b9bbf45a81cd4ee15ae709a0e604464def1bbe88 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Tue, 3 May 2022 21:27:10 +0200 Subject: [PATCH] LibJS: Add assertion (comment) to MakeMatchIndicesIndexPairArray This is an editorial change in the ECMA-262 spec. See: https://github.com/tc39/ecma262/commit/caa6e3f --- Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp b/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp index 7a42c95f88..00d80295ae 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp @@ -149,6 +149,7 @@ static Value make_match_indices_index_pair_array(GlobalObject& global_object, Ut auto match_indices_array = get_match_index_par(global_object, string, entry.value); // e. If i > 0 and groupNames[i - 1] is not undefined, then + // i. Assert: groups is not undefined. // ii. Perform ! CreateDataPropertyOrThrow(groups, groupNames[i - 1], matchIndicesArray). MUST(groups.as_object().create_data_property_or_throw(entry.key, match_indices_array)); }