]> git.kaiwu.me - quickjs.git/commitdiff
fixed Regexp.prototype[Symbol.match]
authorFabrice Bellard <fabrice@bellard.org>
Sat, 24 May 2025 08:12:51 +0000 (10:12 +0200)
committerFabrice Bellard <fabrice@bellard.org>
Sat, 24 May 2025 08:12:51 +0000 (10:12 +0200)
quickjs.c
test262_errors.txt

index 475232c9393320b2ad80177008a7e8b691e519ef..2c545d9c23b939d1cc38b72a843113f94f554fdb 100644 (file)
--- a/quickjs.c
+++ b/quickjs.c
@@ -45369,7 +45369,7 @@ static JSValue js_regexp_Symbol_match(JSContext *ctx, JSValueConst this_val,
             if (JS_IsException(matchStr))
                 goto exception;
             isEmpty = JS_IsEmptyString(matchStr);
-            if (JS_SetPropertyInt64(ctx, A, n++, matchStr) < 0)
+            if (JS_DefinePropertyValueInt64(ctx, A, n++, matchStr, JS_PROP_C_W_E | JS_PROP_THROW) < 0)
                 goto exception;
             if (isEmpty) {
                 int64_t thisIndex, nextIndex;
index d3f06c335e5d09285c3d827cc865daf4c63f989b..dbbcac2e3abedbde5903cde47d55977a48f1c5f5 100644 (file)
@@ -17,7 +17,6 @@ test262/test/staging/sm/RegExp/constructor-ordering-2.js:15: Test262Error: Expec
 test262/test/staging/sm/RegExp/regress-613820-1.js:13: Test262Error: Expected SameValue(«"aaa"», «"aa"») to be true
 test262/test/staging/sm/RegExp/regress-613820-2.js:13: Test262Error: Expected SameValue(«"f"», «undefined») to be true
 test262/test/staging/sm/RegExp/regress-613820-3.js:13: Test262Error: Expected SameValue(«"aab"», «"aa"») to be true
-test262/test/staging/sm/String/match-defines-match-elements.js:52: Test262Error: Expected SameValue(«true», «false») to be true
 test262/test/staging/sm/TypedArray/constructor-buffer-sequence.js:73: Error: Assertion failed: expected exception ExpectedError, got Error: Poisoned Value
 test262/test/staging/sm/TypedArray/prototype-constructor-identity.js:17: Test262Error: Expected SameValue(«2», «6») to be true
 test262/test/staging/sm/TypedArray/set-detached-bigint.js:27: Error: Assertion failed: expected exception SyntaxError, got RangeError: invalid array length