]> git.kaiwu.me - quickjs.git/commitdiff
fixed RegExp.prototype[Symbol.split]
authorFabrice Bellard <fabrice@bellard.org>
Tue, 22 Apr 2025 17:01:43 +0000 (19:01 +0200)
committerFabrice Bellard <fabrice@bellard.org>
Tue, 22 Apr 2025 17:01:43 +0000 (19:01 +0200)
quickjs.c

index 0268061d4a4c80fefb39d441c03cc5064d702c51..edd0daa9494829721d554d3bf08ba95386475e76 100644 (file)
--- a/quickjs.c
+++ b/quickjs.c
@@ -44957,7 +44957,7 @@ static JSValue js_regexp_Symbol_split(JSContext *ctx, JSValueConst this_val,
                 if (js_get_length64(ctx, &numberOfCaptures, z))
                     goto exception;
                 for(i = 1; i < numberOfCaptures; i++) {
-                    sub = JS_ToStringFree(ctx, JS_GetPropertyInt64(ctx, z, i));
+                    sub = JS_GetPropertyInt64(ctx, z, i);
                     if (JS_IsException(sub))
                         goto exception;
                     if (JS_DefinePropertyValueInt64(ctx, A, lengthA++, sub, JS_PROP_C_W_E | JS_PROP_THROW) < 0)