diff --git a/static_core/plugins/ets/stdlib/escompat/RegExp.ets b/static_core/plugins/ets/stdlib/escompat/RegExp.ets index 7d176d9d27a492f211c9cce20c2213df5e20f88b..fe4b3245ca89be65d7f5345432d93ed268d6d6eb 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()