From 3075eeb4bc8b146b4c0e652925d111b9910019be Mon Sep 17 00:00:00 2001 From: Martin Sajti Date: Mon, 1 Sep 2025 10:25:43 +0200 Subject: [PATCH] Fix erroneous stdlib code A bug has been fixed in the frontend that allowed some incorrect code to pass the checker. After the FE fix, this patch repairs the stdlib code. Issue: https://gitee.com/openharmony/arkcompiler_runtime_core/issues/ICWZWE Internal issue: #29382 Test: build Change-Id: Ib136a5ee4748edcbdb1735e94c2250d6a4ecaf46 Signed-off-by: Martin Sajti --- static_core/plugins/ets/stdlib/escompat/RegExp.ets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static_core/plugins/ets/stdlib/escompat/RegExp.ets b/static_core/plugins/ets/stdlib/escompat/RegExp.ets index 7d176d9d27..fe4b3245ca 100644 --- a/static_core/plugins/ets/stdlib/escompat/RegExp.ets +++ b/static_core/plugins/ets/stdlib/escompat/RegExp.ets @@ -1284,7 +1284,7 @@ export class RegExp extends Object { } let matchStr = result.$_get(0) if (matchStr == "") { - this.lastIndex = RegExp.advanceStringIndex(str, this.lastIndex, this.unicode) + this.lastIndex = RegExp.advanceStringIndex(str, this.lastIndex.toInt(), this.unicode) } } let lengthS = str.getLength() @@ -1330,7 +1330,7 @@ export class RegExp extends Object { } let matchStr = result.$_get(0) if (matchStr == "") { - this.lastIndex = RegExp.advanceStringIndex(str, this.lastIndex, this.unicode) + this.lastIndex = RegExp.advanceStringIndex(str, this.lastIndex.toInt(), this.unicode) } } let lengthS = str.getLength() -- Gitee