Fix THROW_TYPE_ERROR_AND_RETURN Part 4

Issue:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I7L6ZC

Signed-off-by: 王笑佳 <wangxiaojia5@huawei.com>
This commit is contained in:
王笑佳 2023-07-14 15:05:06 +08:00
parent d852d04892
commit d2b96b3de5
2 changed files with 2 additions and 0 deletions

View File

@ -608,6 +608,7 @@ bool JsonStringifier::SerializeJSArray(const JSHandle<JSTaggedValue> &value, con
if (len > 0) {
for (uint32_t i = 0; i < len; i++) {
JSTaggedValue tagVal = ObjectFastOperator::FastGetPropertyByIndex(thread_, value.GetTaggedValue(), i);
RETURN_VALUE_IF_ABRUPT_COMPLETION(thread_, false);
if (UNLIKELY(tagVal.IsAccessor())) {
tagVal = JSObject::CallGetter(thread_, AccessorData::Cast(tagVal.GetTaggedObject()), value);
}

View File

@ -866,6 +866,7 @@ JSTaggedValue BuiltinsRegExp::Replace(EcmaRuntimeCallInfo *argv)
// 16. Repeat, for each result in results,
for (int i = 0; i < resultsIndex; i++) {
resultValues.Update(ObjectFastOperator::FastGetPropertyByIndex(thread, resultsList.GetTaggedValue(), i));
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
// a. Let nCaptures be ToLength(Get(result, "length")).
JSHandle<JSTaggedValue> lengthHandle = globalConst->GetHandledLengthString();
ncapturesHandle.Update(ObjectFastOperator::FastGetPropertyByValue(