In-regExp useCache error

issue:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I9KVN8

Signed-off-by: jiachong <jiachong6@huawei.com>
Change-Id: Iabd9c03984a9023d924cba8f61642e4f0462ef15
This commit is contained in:
jiachong 2024-04-30 14:27:39 +08:00
parent fe6e41c3c7
commit 4bf5b6bfbf
3 changed files with 12 additions and 1 deletions

View File

@ -999,6 +999,7 @@ JSTaggedValue BuiltinsRegExp::ReplaceInternal(JSThread *thread,
}
} else {
// 9. ReturnIfAbrupt(global).
useCache = false;
isGlobal = GetFlag(thread, thisObj, RegExpParser::FLAG_GLOBAL, isFastPath);
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
// 10. If global is true, then

View File

@ -145,3 +145,4 @@ null
[object Object]
false
false
success

View File

@ -614,4 +614,13 @@ delete e.exec;
for (let v3 = 0; v3 < 2; v3++) {
print(v2.test(-194290175n));
}
}
}
function f(...args) {
return {};
}
let reg51 = new RegExp("a");
f.exec = f;
let relpfun = reg51[Symbol.replace];
relpfun.apply(f, [1, 2, 3, 4]);
print("success");