mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-11-23 18:20:04 +00:00
Fix THROW_TYPE_ERROR_AND_RETURN Part 1
Issue:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I7JU9Q Signed-off-by: 王笑佳 <wangxiaojia5@huawei.com>
This commit is contained in:
parent
d852d04892
commit
f2c60fbed0
@ -187,6 +187,7 @@ JSTaggedValue ArrayHelper::FlattenIntoArray(JSThread *thread, const JSHandle<JSO
|
|||||||
while (sourceIndex < args.sourceLen) {
|
while (sourceIndex < args.sourceLen) {
|
||||||
sourceIndexHandle.Update(JSTaggedValue(sourceIndex));
|
sourceIndexHandle.Update(JSTaggedValue(sourceIndex));
|
||||||
sourceIndexStr = JSTaggedValue::ToString(thread, sourceIndexHandle);
|
sourceIndexStr = JSTaggedValue::ToString(thread, sourceIndexHandle);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
p.Update(sourceIndexStr.GetTaggedValue());
|
p.Update(sourceIndexStr.GetTaggedValue());
|
||||||
bool exists = JSTaggedValue::HasProperty(thread, thisObjVal, p);
|
bool exists = JSTaggedValue::HasProperty(thread, thisObjVal, p);
|
||||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
@ -227,6 +228,7 @@ JSTaggedValue ArrayHelper::FlattenIntoArray(JSThread *thread, const JSHandle<JSO
|
|||||||
}
|
}
|
||||||
sourceIndexHandle.Update(JSTaggedValue(tempArgs.start));
|
sourceIndexHandle.Update(JSTaggedValue(tempArgs.start));
|
||||||
sourceIndexStr = JSTaggedValue::ToString(thread, sourceIndexHandle);
|
sourceIndexStr = JSTaggedValue::ToString(thread, sourceIndexHandle);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
targetIndexHandle.Update(sourceIndexStr.GetTaggedValue());
|
targetIndexHandle.Update(sourceIndexStr.GetTaggedValue());
|
||||||
JSObject::CreateDataPropertyOrThrow(thread, newArrayHandle, targetIndexHandle, element);
|
JSObject::CreateDataPropertyOrThrow(thread, newArrayHandle, targetIndexHandle, element);
|
||||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
|
@ -22,9 +22,11 @@ JSHandle<JSTaggedValue> Internalize::InternalizeJsonProperty(JSThread *thread, c
|
|||||||
{
|
{
|
||||||
JSHandle<JSTaggedValue> objHandle(holder);
|
JSHandle<JSTaggedValue> objHandle(holder);
|
||||||
JSHandle<JSTaggedValue> val = JSTaggedValue::GetProperty(thread, objHandle, name).GetValue();
|
JSHandle<JSTaggedValue> val = JSTaggedValue::GetProperty(thread, objHandle, name).GetValue();
|
||||||
|
RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSTaggedValue, thread);
|
||||||
JSHandle<JSTaggedValue> lengthKey = thread->GlobalConstants()->GetHandledLengthString();
|
JSHandle<JSTaggedValue> lengthKey = thread->GlobalConstants()->GetHandledLengthString();
|
||||||
if (val->IsECMAObject()) {
|
if (val->IsECMAObject()) {
|
||||||
JSHandle<JSObject> obj = JSTaggedValue::ToObject(thread, val);
|
JSHandle<JSObject> obj = JSTaggedValue::ToObject(thread, val);
|
||||||
|
RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSTaggedValue, thread);
|
||||||
bool isArray = val->IsArray(thread);
|
bool isArray = val->IsArray(thread);
|
||||||
if (isArray) {
|
if (isArray) {
|
||||||
JSHandle<JSTaggedValue> lenResult = JSTaggedValue::GetProperty(thread, val, lengthKey).GetValue();
|
JSHandle<JSTaggedValue> lenResult = JSTaggedValue::GetProperty(thread, val, lengthKey).GetValue();
|
||||||
@ -38,6 +40,7 @@ JSHandle<JSTaggedValue> Internalize::InternalizeJsonProperty(JSThread *thread, c
|
|||||||
// Let prop be ! ToString((I)).
|
// Let prop be ! ToString((I)).
|
||||||
keyUnknow.Update(JSTaggedValue(i));
|
keyUnknow.Update(JSTaggedValue(i));
|
||||||
keyName.Update(JSTaggedValue::ToString(thread, keyUnknow).GetTaggedValue());
|
keyName.Update(JSTaggedValue::ToString(thread, keyUnknow).GetTaggedValue());
|
||||||
|
RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSTaggedValue, thread);
|
||||||
RecurseAndApply(thread, obj, keyName, receiver);
|
RecurseAndApply(thread, obj, keyName, receiver);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -385,6 +385,7 @@ private:
|
|||||||
// slow path
|
// slow path
|
||||||
JSTaggedValue::SetProperty(thread_, JSHandle<JSTaggedValue>(result), keyHandle,
|
JSTaggedValue::SetProperty(thread_, JSHandle<JSTaggedValue>(result), keyHandle,
|
||||||
JSHandle<JSTaggedValue>(thread_, value), true);
|
JSHandle<JSTaggedValue>(thread_, value), true);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread_);
|
||||||
}
|
}
|
||||||
GetNextNonSpaceChar();
|
GetNextNonSpaceChar();
|
||||||
if (*current_ == ',') {
|
if (*current_ == ',') {
|
||||||
|
@ -477,6 +477,7 @@ bool JsonStringifier::SerializeJSONObject(const JSHandle<JSTaggedValue> &value,
|
|||||||
for (uint32_t i = 0; i < arrLength; i++) {
|
for (uint32_t i = 0; i < arrLength; i++) {
|
||||||
handleKey_.Update(propertyArray->Get(i));
|
handleKey_.Update(propertyArray->Get(i));
|
||||||
JSHandle<JSTaggedValue> valueHandle = JSTaggedValue::GetProperty(thread_, value, handleKey_).GetValue();
|
JSHandle<JSTaggedValue> valueHandle = JSTaggedValue::GetProperty(thread_, value, handleKey_).GetValue();
|
||||||
|
RETURN_VALUE_IF_ABRUPT_COMPLETION(thread_, false);
|
||||||
JSTaggedValue serializeValue = GetSerializeValue(value, handleKey_, valueHandle, replacer);
|
JSTaggedValue serializeValue = GetSerializeValue(value, handleKey_, valueHandle, replacer);
|
||||||
RETURN_VALUE_IF_ABRUPT_COMPLETION(thread_, false);
|
RETURN_VALUE_IF_ABRUPT_COMPLETION(thread_, false);
|
||||||
if (UNLIKELY(serializeValue.IsUndefined() || serializeValue.IsSymbol() ||
|
if (UNLIKELY(serializeValue.IsUndefined() || serializeValue.IsSymbol() ||
|
||||||
|
@ -154,6 +154,7 @@ JSTaggedValue TypedArrayHelper::CreateFromOrdinaryObject(EcmaRuntimeCallInfo *ar
|
|||||||
while (k < len) {
|
while (k < len) {
|
||||||
tKey.Update(JSTaggedValue(k));
|
tKey.Update(JSTaggedValue(k));
|
||||||
JSHandle<JSTaggedValue> kKey(JSTaggedValue::ToString(thread, tKey));
|
JSHandle<JSTaggedValue> kKey(JSTaggedValue::ToString(thread, tKey));
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
JSHandle<JSTaggedValue> kValue = vec[k];
|
JSHandle<JSTaggedValue> kValue = vec[k];
|
||||||
JSTaggedValue::SetProperty(thread, JSHandle<JSTaggedValue>::Cast(obj), kKey, kValue, true);
|
JSTaggedValue::SetProperty(thread, JSHandle<JSTaggedValue>::Cast(obj), kKey, kValue, true);
|
||||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
@ -187,6 +188,7 @@ JSTaggedValue TypedArrayHelper::CreateFromOrdinaryObject(EcmaRuntimeCallInfo *ar
|
|||||||
while (k < len) {
|
while (k < len) {
|
||||||
tKey.Update(JSTaggedValue(k));
|
tKey.Update(JSTaggedValue(k));
|
||||||
JSHandle<JSTaggedValue> kKey(JSTaggedValue::ToString(thread, tKey));
|
JSHandle<JSTaggedValue> kKey(JSTaggedValue::ToString(thread, tKey));
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
JSHandle<JSTaggedValue> kValue = JSObject::GetProperty(thread, objectArg, kKey).GetValue();
|
JSHandle<JSTaggedValue> kValue = JSObject::GetProperty(thread, objectArg, kKey).GetValue();
|
||||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
JSTaggedValue::SetProperty(thread, JSHandle<JSTaggedValue>::Cast(obj), kKey, kValue, true);
|
JSTaggedValue::SetProperty(thread, JSHandle<JSTaggedValue>::Cast(obj), kKey, kValue, true);
|
||||||
|
@ -38,6 +38,7 @@ JSTaggedValue BuiltinsArkTools::ObjectDump(EcmaRuntimeCallInfo *info)
|
|||||||
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
||||||
|
|
||||||
JSHandle<EcmaString> str = JSTaggedValue::ToString(thread, GetCallArg(info, 0));
|
JSHandle<EcmaString> str = JSTaggedValue::ToString(thread, GetCallArg(info, 0));
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
// The default log level of ace_engine and js_runtime is error
|
// The default log level of ace_engine and js_runtime is error
|
||||||
LOG_ECMA(ERROR) << ": " << EcmaStringAccessor(str).ToStdString();
|
LOG_ECMA(ERROR) << ": " << EcmaStringAccessor(str).ToStdString();
|
||||||
|
|
||||||
@ -209,6 +210,7 @@ JSTaggedValue BuiltinsArkTools::StartCpuProfiler(EcmaRuntimeCallInfo *info)
|
|||||||
std::string fileName = "";
|
std::string fileName = "";
|
||||||
if (fileNameValue->IsString()) {
|
if (fileNameValue->IsString()) {
|
||||||
JSHandle<EcmaString> str = JSTaggedValue::ToString(thread, fileNameValue);
|
JSHandle<EcmaString> str = JSTaggedValue::ToString(thread, fileNameValue);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
fileName = EcmaStringAccessor(str).ToStdString() + ".cpuprofile";
|
fileName = EcmaStringAccessor(str).ToStdString() + ".cpuprofile";
|
||||||
} else {
|
} else {
|
||||||
fileName = GetProfileName();
|
fileName = GetProfileName();
|
||||||
|
@ -644,6 +644,7 @@ JSTaggedValue BuiltinsArray::CopyWithin(EcmaRuntimeCallInfo *argv)
|
|||||||
} else {
|
} else {
|
||||||
if (thisObjVal->IsJSProxy()) {
|
if (thisObjVal->IsJSProxy()) {
|
||||||
toKey.Update(JSTaggedValue::ToString(thread, toKey).GetTaggedValue());
|
toKey.Update(JSTaggedValue::ToString(thread, toKey).GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
}
|
}
|
||||||
JSTaggedValue::DeletePropertyOrThrow(thread, thisObjVal, toKey);
|
JSTaggedValue::DeletePropertyOrThrow(thread, thisObjVal, toKey);
|
||||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
@ -2369,6 +2370,7 @@ JSTaggedValue BuiltinsArray::Splice(EcmaRuntimeCallInfo *argv)
|
|||||||
toKey.Update(JSTaggedValue(k));
|
toKey.Update(JSTaggedValue(k));
|
||||||
if (newArrayHandle->IsJSProxy()) {
|
if (newArrayHandle->IsJSProxy()) {
|
||||||
toKey.Update(JSTaggedValue::ToString(thread, toKey).GetTaggedValue());
|
toKey.Update(JSTaggedValue::ToString(thread, toKey).GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
}
|
}
|
||||||
JSObject::CreateDataPropertyOrThrow(thread, newArrayHandle, toKey, fromValue);
|
JSObject::CreateDataPropertyOrThrow(thread, newArrayHandle, toKey, fromValue);
|
||||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
@ -2914,6 +2916,7 @@ JSTaggedValue BuiltinsArray::Includes(EcmaRuntimeCallInfo *argv)
|
|||||||
while (from < len) {
|
while (from < len) {
|
||||||
JSHandle<JSTaggedValue> handledFrom(thread, JSTaggedValue(from));
|
JSHandle<JSTaggedValue> handledFrom(thread, JSTaggedValue(from));
|
||||||
fromStr = JSTaggedValue::ToString(thread, handledFrom);
|
fromStr = JSTaggedValue::ToString(thread, handledFrom);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
key.Update(fromStr.GetTaggedValue());
|
key.Update(fromStr.GetTaggedValue());
|
||||||
kValueHandle.Update(JSArray::FastGetPropertyByValue(thread, thisObjVal, key).GetTaggedValue());
|
kValueHandle.Update(JSArray::FastGetPropertyByValue(thread, thisObjVal, key).GetTaggedValue());
|
||||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
|
@ -184,6 +184,7 @@ JSTaggedValue BuiltinsAggregateError::AggregateErrorConstructor(EcmaRuntimeCallI
|
|||||||
JSHandle<JSTaggedValue> errorsValues(JSArray::CreateArrayFromList(thread, errorsArray));
|
JSHandle<JSTaggedValue> errorsValues(JSArray::CreateArrayFromList(thread, errorsArray));
|
||||||
PropertyDescriptor msgDesc(thread, errorsValues, true, false, true);
|
PropertyDescriptor msgDesc(thread, errorsValues, true, false, true);
|
||||||
JSTaggedValue::DefinePropertyOrThrow(thread, taggedObj, errorsKey, msgDesc);
|
JSTaggedValue::DefinePropertyOrThrow(thread, taggedObj, errorsKey, msgDesc);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
// 6. Return O.
|
// 6. Return O.
|
||||||
return taggedObj.GetTaggedValue();
|
return taggedObj.GetTaggedValue();
|
||||||
}
|
}
|
||||||
|
@ -206,6 +206,7 @@ JSTaggedValue BuiltinsFunction::FunctionPrototypeBind(EcmaRuntimeCallInfo *argv)
|
|||||||
PropertyDescriptor desc(thread, JSHandle<JSTaggedValue>(thread, JSTaggedValue(lengthValue)), false, false, true);
|
PropertyDescriptor desc(thread, JSHandle<JSTaggedValue>(thread, JSTaggedValue(lengthValue)), false, false, true);
|
||||||
[[maybe_unused]] bool status =
|
[[maybe_unused]] bool status =
|
||||||
JSTaggedValue::DefinePropertyOrThrow(thread, JSHandle<JSTaggedValue>(boundFunction), lengthKey, desc);
|
JSTaggedValue::DefinePropertyOrThrow(thread, JSHandle<JSTaggedValue>(boundFunction), lengthKey, desc);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
// 11. Assert: status is not an abrupt completion.
|
// 11. Assert: status is not an abrupt completion.
|
||||||
ASSERT_PRINT(status, "DefinePropertyOrThrow failed");
|
ASSERT_PRINT(status, "DefinePropertyOrThrow failed");
|
||||||
|
|
||||||
|
@ -40,6 +40,7 @@ JSTaggedValue BuiltinsGenerator::GeneratorPrototypeNext(EcmaRuntimeCallInfo *arg
|
|||||||
THROW_TYPE_ERROR_AND_RETURN(thread, "Not a generator object.", JSTaggedValue::Exception());
|
THROW_TYPE_ERROR_AND_RETURN(thread, "Not a generator object.", JSTaggedValue::Exception());
|
||||||
}
|
}
|
||||||
JSHandle<JSGeneratorObject> generator(thread, JSGeneratorObject::Cast(*JSTaggedValue::ToObject(thread, msg)));
|
JSHandle<JSGeneratorObject> generator(thread, JSGeneratorObject::Cast(*JSTaggedValue::ToObject(thread, msg)));
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
JSHandle<JSTaggedValue> value = GetCallArg(argv, 0);
|
JSHandle<JSTaggedValue> value = GetCallArg(argv, 0);
|
||||||
|
|
||||||
// 2.Return ? GeneratorResume(g, value).
|
// 2.Return ? GeneratorResume(g, value).
|
||||||
@ -60,7 +61,7 @@ JSTaggedValue BuiltinsGenerator::GeneratorPrototypeReturn(EcmaRuntimeCallInfo *a
|
|||||||
THROW_TYPE_ERROR_AND_RETURN(thread, "Not a generator object.", JSTaggedValue::Exception());
|
THROW_TYPE_ERROR_AND_RETURN(thread, "Not a generator object.", JSTaggedValue::Exception());
|
||||||
}
|
}
|
||||||
JSHandle<JSGeneratorObject> generator(thread, JSGeneratorObject::Cast(*JSTaggedValue::ToObject(thread, msg)));
|
JSHandle<JSGeneratorObject> generator(thread, JSGeneratorObject::Cast(*JSTaggedValue::ToObject(thread, msg)));
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
// 2.Let C be Completion { [[Type]]: return, [[Value]]: value, [[Target]]: empty }.
|
// 2.Let C be Completion { [[Type]]: return, [[Value]]: value, [[Target]]: empty }.
|
||||||
JSHandle<JSTaggedValue> value = GetCallArg(argv, 0);
|
JSHandle<JSTaggedValue> value = GetCallArg(argv, 0);
|
||||||
ObjectFactory *factory = thread->GetEcmaVM()->GetFactory();
|
ObjectFactory *factory = thread->GetEcmaVM()->GetFactory();
|
||||||
@ -85,7 +86,7 @@ JSTaggedValue BuiltinsGenerator::GeneratorPrototypeThrow(EcmaRuntimeCallInfo *ar
|
|||||||
THROW_TYPE_ERROR_AND_RETURN(thread, "Not a generator object.", JSTaggedValue::Exception());
|
THROW_TYPE_ERROR_AND_RETURN(thread, "Not a generator object.", JSTaggedValue::Exception());
|
||||||
}
|
}
|
||||||
JSHandle<JSGeneratorObject> generator(thread, JSGeneratorObject::Cast(*JSTaggedValue::ToObject(thread, msg)));
|
JSHandle<JSGeneratorObject> generator(thread, JSGeneratorObject::Cast(*JSTaggedValue::ToObject(thread, msg)));
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
// 2.Let C be ThrowCompletion(exception).
|
// 2.Let C be ThrowCompletion(exception).
|
||||||
JSHandle<JSTaggedValue> exception = GetCallArg(argv, 0);
|
JSHandle<JSTaggedValue> exception = GetCallArg(argv, 0);
|
||||||
ObjectFactory *factory = thread->GetEcmaVM()->GetFactory();
|
ObjectFactory *factory = thread->GetEcmaVM()->GetFactory();
|
||||||
|
@ -56,6 +56,7 @@ JSTaggedValue BuiltinsLocale::LocaleConstructor(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<EcmaString> localeString = factory->GetEmptyString();
|
JSHandle<EcmaString> localeString = factory->GetEmptyString();
|
||||||
if (!tag->IsJSLocale()) {
|
if (!tag->IsJSLocale()) {
|
||||||
localeString = JSTaggedValue::ToString(thread, tag);
|
localeString = JSTaggedValue::ToString(thread, tag);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
} else {
|
} else {
|
||||||
icu::Locale *icuLocale = (JSHandle<JSLocale>::Cast(tag))->GetIcuLocale();
|
icu::Locale *icuLocale = (JSHandle<JSLocale>::Cast(tag))->GetIcuLocale();
|
||||||
localeString = intl::LocaleHelper::ToLanguageTag(thread, *icuLocale);
|
localeString = intl::LocaleHelper::ToLanguageTag(thread, *icuLocale);
|
||||||
|
@ -134,6 +134,7 @@ JSTaggedValue BuiltinsMap::Has(EcmaRuntimeCallInfo *argv)
|
|||||||
THROW_TYPE_ERROR_AND_RETURN(thread, "obj is not JSMap", JSTaggedValue::Exception());
|
THROW_TYPE_ERROR_AND_RETURN(thread, "obj is not JSMap", JSTaggedValue::Exception());
|
||||||
}
|
}
|
||||||
JSMap *jsMap = JSMap::Cast(*JSTaggedValue::ToObject(thread, self));
|
JSMap *jsMap = JSMap::Cast(*JSTaggedValue::ToObject(thread, self));
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
JSHandle<JSTaggedValue> key = GetCallArg(argv, 0);
|
JSHandle<JSTaggedValue> key = GetCallArg(argv, 0);
|
||||||
bool flag = jsMap->Has(key.GetTaggedValue());
|
bool flag = jsMap->Has(key.GetTaggedValue());
|
||||||
return GetTaggedBoolean(flag);
|
return GetTaggedBoolean(flag);
|
||||||
@ -151,6 +152,7 @@ JSTaggedValue BuiltinsMap::Get(EcmaRuntimeCallInfo *argv)
|
|||||||
THROW_TYPE_ERROR_AND_RETURN(thread, "obj is not JSMap", JSTaggedValue::Exception());
|
THROW_TYPE_ERROR_AND_RETURN(thread, "obj is not JSMap", JSTaggedValue::Exception());
|
||||||
}
|
}
|
||||||
JSMap *jsMap = JSMap::Cast(*JSTaggedValue::ToObject(thread, self));
|
JSMap *jsMap = JSMap::Cast(*JSTaggedValue::ToObject(thread, self));
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
JSHandle<JSTaggedValue> key = GetCallArg(argv, 0);
|
JSHandle<JSTaggedValue> key = GetCallArg(argv, 0);
|
||||||
JSTaggedValue value = jsMap->Get(key.GetTaggedValue());
|
JSTaggedValue value = jsMap->Get(key.GetTaggedValue());
|
||||||
return value;
|
return value;
|
||||||
@ -228,6 +230,7 @@ JSTaggedValue BuiltinsMap::GetSize(EcmaRuntimeCallInfo *argv)
|
|||||||
THROW_TYPE_ERROR_AND_RETURN(thread, "obj is not JSMap", JSTaggedValue::Exception());
|
THROW_TYPE_ERROR_AND_RETURN(thread, "obj is not JSMap", JSTaggedValue::Exception());
|
||||||
}
|
}
|
||||||
JSMap *jsMap = JSMap::Cast(*JSTaggedValue::ToObject(thread, self));
|
JSMap *jsMap = JSMap::Cast(*JSTaggedValue::ToObject(thread, self));
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
int count = jsMap->GetSize();
|
int count = jsMap->GetSize();
|
||||||
return JSTaggedValue(count);
|
return JSTaggedValue(count);
|
||||||
}
|
}
|
||||||
|
@ -730,6 +730,7 @@ JSTaggedValue BuiltinsObject::IsPrototypeOf(EcmaRuntimeCallInfo *argv)
|
|||||||
return GetTaggedBoolean(true);
|
return GetTaggedBoolean(true);
|
||||||
}
|
}
|
||||||
msgValueHandle.Update(JSTaggedValue::GetPrototype(thread, msgValueHandle));
|
msgValueHandle.Update(JSTaggedValue::GetPrototype(thread, msgValueHandle));
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
}
|
}
|
||||||
return GetTaggedBoolean(false);
|
return GetTaggedBoolean(false);
|
||||||
}
|
}
|
||||||
@ -874,6 +875,7 @@ JSTaggedValue BuiltinsObject::ToString(EcmaRuntimeCallInfo *argv)
|
|||||||
|
|
||||||
JSHandle<EcmaString> newLeftStringHandle =
|
JSHandle<EcmaString> newLeftStringHandle =
|
||||||
factory->ConcatFromString(leftString, JSTaggedValue::ToString(thread, tag));
|
factory->ConcatFromString(leftString, JSTaggedValue::ToString(thread, tag));
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
auto result = factory->ConcatFromString(newLeftStringHandle, rightString);
|
auto result = factory->ConcatFromString(newLeftStringHandle, rightString);
|
||||||
return result.GetTaggedValue();
|
return result.GetTaggedValue();
|
||||||
}
|
}
|
||||||
|
@ -759,6 +759,7 @@ JSHandle<CompletionRecord> BuiltinsPromise::PerformPromiseAny(JSThread *thread,
|
|||||||
PropertyDescriptor msgDesc(thread, errorsValue, true, false, true);
|
PropertyDescriptor msgDesc(thread, errorsValue, true, false, true);
|
||||||
JSHandle<JSTaggedValue> errorTagged = JSHandle<JSTaggedValue>::Cast(error);
|
JSHandle<JSTaggedValue> errorTagged = JSHandle<JSTaggedValue>::Cast(error);
|
||||||
JSTaggedValue::DefinePropertyOrThrow(thread, errorTagged, errorsKey, msgDesc);
|
JSTaggedValue::DefinePropertyOrThrow(thread, errorTagged, errorsKey, msgDesc);
|
||||||
|
RETURN_HANDLE_IF_ABRUPT_COMPLETION(CompletionRecord, thread);
|
||||||
// 3. Return ThrowCompletion(error).
|
// 3. Return ThrowCompletion(error).
|
||||||
JSHandle<JSTaggedValue> errorCompletion(
|
JSHandle<JSTaggedValue> errorCompletion(
|
||||||
factory->NewCompletionRecord(CompletionRecordType::THROW, errorTagged));
|
factory->NewCompletionRecord(CompletionRecordType::THROW, errorTagged));
|
||||||
|
@ -550,6 +550,7 @@ JSTaggedValue BuiltinsPromiseHandler::AnyRejectElementFunction(EcmaRuntimeCallIn
|
|||||||
PropertyDescriptor msgDesc(thread, errorsValue, true, false, true);
|
PropertyDescriptor msgDesc(thread, errorsValue, true, false, true);
|
||||||
JSHandle<JSTaggedValue> errorTagged = JSHandle<JSTaggedValue>::Cast(error);
|
JSHandle<JSTaggedValue> errorTagged = JSHandle<JSTaggedValue>::Cast(error);
|
||||||
JSTaggedValue::DefinePropertyOrThrow(thread, errorTagged, errorsKey, msgDesc);
|
JSTaggedValue::DefinePropertyOrThrow(thread, errorTagged, errorsKey, msgDesc);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
// c. Return ? Call(promiseCapability.[[Reject]], undefined, « error »).
|
// c. Return ? Call(promiseCapability.[[Reject]], undefined, « error »).
|
||||||
JSHandle<JSTaggedValue> capaReject(thread, capa->GetReject());
|
JSHandle<JSTaggedValue> capaReject(thread, capa->GetReject());
|
||||||
JSHandle<JSTaggedValue> undefined(globalConst->GetHandledUndefined());
|
JSHandle<JSTaggedValue> undefined(globalConst->GetHandledUndefined());
|
||||||
|
@ -95,6 +95,7 @@ JSTaggedValue BuiltinsRegExp::RegExpConstructor(EcmaRuntimeCallInfo *argv)
|
|||||||
// 5.c Else, let F be flags.
|
// 5.c Else, let F be flags.
|
||||||
flagsTemp = JSHandle<JSTaggedValue>(thread, *JSTaggedValue::ToString(thread, flags));
|
flagsTemp = JSHandle<JSTaggedValue>(thread, *JSTaggedValue::ToString(thread, flags));
|
||||||
}
|
}
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
// 6. Else if patternIsRegExp is true
|
// 6. Else if patternIsRegExp is true
|
||||||
} else if (patternIsRegExp) {
|
} else if (patternIsRegExp) {
|
||||||
JSHandle<JSTaggedValue> sourceString(globalConst->GetHandledSourceString());
|
JSHandle<JSTaggedValue> sourceString(globalConst->GetHandledSourceString());
|
||||||
@ -114,6 +115,7 @@ JSTaggedValue BuiltinsRegExp::RegExpConstructor(EcmaRuntimeCallInfo *argv)
|
|||||||
} else {
|
} else {
|
||||||
// 6.d Else, let F be flags.
|
// 6.d Else, let F be flags.
|
||||||
flagsTemp = JSHandle<JSTaggedValue>(thread, *JSTaggedValue::ToString(thread, flags));
|
flagsTemp = JSHandle<JSTaggedValue>(thread, *JSTaggedValue::ToString(thread, flags));
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 7.a Let P be pattern.
|
// 7.a Let P be pattern.
|
||||||
@ -123,6 +125,7 @@ JSTaggedValue BuiltinsRegExp::RegExpConstructor(EcmaRuntimeCallInfo *argv)
|
|||||||
flagsTemp = flags;
|
flagsTemp = flags;
|
||||||
} else {
|
} else {
|
||||||
flagsTemp = JSHandle<JSTaggedValue>(thread, *JSTaggedValue::ToString(thread, flags));
|
flagsTemp = JSHandle<JSTaggedValue>(thread, *JSTaggedValue::ToString(thread, flags));
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 8. Let O be RegExpAlloc(newTarget).
|
// 8. Let O be RegExpAlloc(newTarget).
|
||||||
@ -377,6 +380,7 @@ JSTaggedValue BuiltinsRegExp::Match(EcmaRuntimeCallInfo *argv)
|
|||||||
// 3. Let S be ToString(string)
|
// 3. Let S be ToString(string)
|
||||||
JSHandle<JSTaggedValue> inputString = GetCallArg(argv, 0);
|
JSHandle<JSTaggedValue> inputString = GetCallArg(argv, 0);
|
||||||
JSHandle<EcmaString> stringHandle = JSTaggedValue::ToString(thread, inputString);
|
JSHandle<EcmaString> stringHandle = JSTaggedValue::ToString(thread, inputString);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
bool useCache = true;
|
bool useCache = true;
|
||||||
JSHandle<RegExpExecResultCache> cacheTable(thread->GetCurrentEcmaContext()->GetRegExpCache());
|
JSHandle<RegExpExecResultCache> cacheTable(thread->GetCurrentEcmaContext()->GetRegExpCache());
|
||||||
if (cacheTable->GetLargeStrCount() == 0 || cacheTable->GetConflictCount() == 0) {
|
if (cacheTable->GetLargeStrCount() == 0 || cacheTable->GetConflictCount() == 0) {
|
||||||
@ -1437,6 +1441,7 @@ JSTaggedValue BuiltinsRegExp::RegExpBuiltinExec(JSThread *thread, const JSHandle
|
|||||||
return JSTaggedValue::Null();
|
return JSTaggedValue::Null();
|
||||||
}
|
}
|
||||||
JSHandle<EcmaString> inputString = JSTaggedValue::ToString(thread, inputStr);
|
JSHandle<EcmaString> inputString = JSTaggedValue::ToString(thread, inputStr);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
bool isUtf16 = EcmaStringAccessor(inputString).IsUtf16();
|
bool isUtf16 = EcmaStringAccessor(inputString).IsUtf16();
|
||||||
auto inputPtr = EcmaStringAccessor(inputString).ToOneByteDataForced();
|
auto inputPtr = EcmaStringAccessor(inputString).ToOneByteDataForced();
|
||||||
const uint8_t *strBuffer = inputPtr.get();
|
const uint8_t *strBuffer = inputPtr.get();
|
||||||
@ -1548,7 +1553,7 @@ JSTaggedValue BuiltinsRegExp::RegExpExec(JSThread *thread, const JSHandle<JSTagg
|
|||||||
ASSERT(inputString->IsString());
|
ASSERT(inputString->IsString());
|
||||||
// 3. Let exec be Get(R, "exec").
|
// 3. Let exec be Get(R, "exec").
|
||||||
JSHandle<EcmaString> inputStr = JSTaggedValue::ToString(thread, inputString);
|
JSHandle<EcmaString> inputStr = JSTaggedValue::ToString(thread, inputString);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
const GlobalEnvConstants *globalConst = thread->GlobalConstants();
|
const GlobalEnvConstants *globalConst = thread->GlobalConstants();
|
||||||
JSHandle<JSTaggedValue> execHandle = globalConst->GetHandledExecString();
|
JSHandle<JSTaggedValue> execHandle = globalConst->GetHandledExecString();
|
||||||
JSTaggedValue execVal = ObjectFastOperator::FastGetPropertyByValue(thread, regexp.GetTaggedValue(),
|
JSTaggedValue execVal = ObjectFastOperator::FastGetPropertyByValue(thread, regexp.GetTaggedValue(),
|
||||||
|
@ -118,7 +118,7 @@ JSTaggedValue BuiltinsSet::Add(EcmaRuntimeCallInfo *argv)
|
|||||||
|
|
||||||
JSHandle<JSTaggedValue> value(GetCallArg(argv, 0));
|
JSHandle<JSTaggedValue> value(GetCallArg(argv, 0));
|
||||||
JSHandle<JSSet> set(JSTaggedValue::ToObject(thread, self));
|
JSHandle<JSSet> set(JSTaggedValue::ToObject(thread, self));
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
JSSet::Add(thread, set, value);
|
JSSet::Add(thread, set, value);
|
||||||
return set.GetTaggedValue();
|
return set.GetTaggedValue();
|
||||||
}
|
}
|
||||||
@ -137,6 +137,7 @@ JSTaggedValue BuiltinsSet::Clear(EcmaRuntimeCallInfo *argv)
|
|||||||
THROW_TYPE_ERROR_AND_RETURN(thread, "obj is not JSSet", JSTaggedValue::Exception());
|
THROW_TYPE_ERROR_AND_RETURN(thread, "obj is not JSSet", JSTaggedValue::Exception());
|
||||||
}
|
}
|
||||||
JSHandle<JSSet> set(thread, JSSet::Cast(*JSTaggedValue::ToObject(thread, self)));
|
JSHandle<JSSet> set(thread, JSSet::Cast(*JSTaggedValue::ToObject(thread, self)));
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
JSSet::Clear(thread, set);
|
JSSet::Clear(thread, set);
|
||||||
return JSTaggedValue::Undefined();
|
return JSTaggedValue::Undefined();
|
||||||
}
|
}
|
||||||
@ -155,6 +156,7 @@ JSTaggedValue BuiltinsSet::Delete(EcmaRuntimeCallInfo *argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
JSHandle<JSSet> set(thread, JSSet::Cast(*JSTaggedValue::ToObject(thread, self)));
|
JSHandle<JSSet> set(thread, JSSet::Cast(*JSTaggedValue::ToObject(thread, self)));
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
JSHandle<JSTaggedValue> value = GetCallArg(argv, 0);
|
JSHandle<JSTaggedValue> value = GetCallArg(argv, 0);
|
||||||
bool flag = JSSet::Delete(thread, set, value);
|
bool flag = JSSet::Delete(thread, set, value);
|
||||||
return GetTaggedBoolean(flag);
|
return GetTaggedBoolean(flag);
|
||||||
@ -173,6 +175,7 @@ JSTaggedValue BuiltinsSet::Has(EcmaRuntimeCallInfo *argv)
|
|||||||
THROW_TYPE_ERROR_AND_RETURN(thread, "obj is not JSSet", JSTaggedValue::Exception());
|
THROW_TYPE_ERROR_AND_RETURN(thread, "obj is not JSSet", JSTaggedValue::Exception());
|
||||||
}
|
}
|
||||||
JSSet *jsSet = JSSet::Cast(*JSTaggedValue::ToObject(thread, self));
|
JSSet *jsSet = JSSet::Cast(*JSTaggedValue::ToObject(thread, self));
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
JSHandle<JSTaggedValue> value = GetCallArg(argv, 0);
|
JSHandle<JSTaggedValue> value = GetCallArg(argv, 0);
|
||||||
bool flag = jsSet->Has(value.GetTaggedValue());
|
bool flag = jsSet->Has(value.GetTaggedValue());
|
||||||
return GetTaggedBoolean(flag);
|
return GetTaggedBoolean(flag);
|
||||||
@ -250,6 +253,7 @@ JSTaggedValue BuiltinsSet::GetSize(EcmaRuntimeCallInfo *argv)
|
|||||||
THROW_TYPE_ERROR_AND_RETURN(thread, "obj is not JSSet", JSTaggedValue::Exception());
|
THROW_TYPE_ERROR_AND_RETURN(thread, "obj is not JSSet", JSTaggedValue::Exception());
|
||||||
}
|
}
|
||||||
JSSet *jsSet = JSSet::Cast(*JSTaggedValue::ToObject(thread, self));
|
JSSet *jsSet = JSSet::Cast(*JSTaggedValue::ToObject(thread, self));
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
int count = jsSet->GetSize();
|
int count = jsSet->GetSize();
|
||||||
return JSTaggedValue(count);
|
return JSTaggedValue(count);
|
||||||
}
|
}
|
||||||
|
@ -356,6 +356,7 @@ JSTaggedValue BuiltinsString::Concat(EcmaRuntimeCallInfo *argv)
|
|||||||
for (uint32_t i = 0; i < argLength; i++) {
|
for (uint32_t i = 0; i < argLength; i++) {
|
||||||
JSHandle<JSTaggedValue> nextTag = BuiltinsString::GetCallArg(argv, i);
|
JSHandle<JSTaggedValue> nextTag = BuiltinsString::GetCallArg(argv, i);
|
||||||
JSHandle<EcmaString> nextHandle = JSTaggedValue::ToString(thread, nextTag);
|
JSHandle<EcmaString> nextHandle = JSTaggedValue::ToString(thread, nextTag);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
u16strNext = EcmaStringAccessor(nextHandle).ToU16String();
|
u16strNext = EcmaStringAccessor(nextHandle).ToU16String();
|
||||||
if (EcmaStringAccessor(nextHandle).IsUtf16()) {
|
if (EcmaStringAccessor(nextHandle).IsUtf16()) {
|
||||||
canBeCompress = false;
|
canBeCompress = false;
|
||||||
@ -899,6 +900,7 @@ JSTaggedValue BuiltinsString::Replace(EcmaRuntimeCallInfo *argv)
|
|||||||
replHandle.Update(GetSubstitution(thread, searchString, thisString, pos, capturesList, undefined, replacement));
|
replHandle.Update(GetSubstitution(thread, searchString, thisString, pos, capturesList, undefined, replacement));
|
||||||
}
|
}
|
||||||
JSHandle<EcmaString> realReplaceStr = JSTaggedValue::ToString(thread, replHandle);
|
JSHandle<EcmaString> realReplaceStr = JSTaggedValue::ToString(thread, replHandle);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
// Let tailPos be pos + the number of code units in matched.
|
// Let tailPos be pos + the number of code units in matched.
|
||||||
int32_t tailPos = pos + static_cast<int32_t>(EcmaStringAccessor(searchString).GetLength());
|
int32_t tailPos = pos + static_cast<int32_t>(EcmaStringAccessor(searchString).GetLength());
|
||||||
// Let newString be the String formed by concatenating the first pos code units of string,
|
// Let newString be the String formed by concatenating the first pos code units of string,
|
||||||
@ -1021,6 +1023,7 @@ JSTaggedValue BuiltinsString::ReplaceAll(EcmaRuntimeCallInfo *argv)
|
|||||||
capturesList, undefined, replacement));
|
capturesList, undefined, replacement));
|
||||||
}
|
}
|
||||||
JSHandle<EcmaString> realReplaceStr = JSTaggedValue::ToString(thread, replHandle);
|
JSHandle<EcmaString> realReplaceStr = JSTaggedValue::ToString(thread, replHandle);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
// Let tailPos be pos + the number of code units in matched.
|
// Let tailPos be pos + the number of code units in matched.
|
||||||
// Let newString be the String formed by concatenating the first pos code units of string,
|
// Let newString be the String formed by concatenating the first pos code units of string,
|
||||||
// replStr, and the trailing substring of string starting at index tailPos.
|
// replStr, and the trailing substring of string starting at index tailPos.
|
||||||
@ -1847,6 +1850,7 @@ JSTaggedValue BuiltinsString::GetLength(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> thisHandle = GetThis(argv);
|
JSHandle<JSTaggedValue> thisHandle = GetThis(argv);
|
||||||
|
|
||||||
JSHandle<EcmaString> thisString = JSTaggedValue::ToString(thread, thisHandle);
|
JSHandle<EcmaString> thisString = JSTaggedValue::ToString(thread, thisHandle);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
return GetTaggedInt(EcmaStringAccessor(thisString).GetLength());
|
return GetTaggedInt(EcmaStringAccessor(thisString).GetLength());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1890,6 +1894,7 @@ JSTaggedValue BuiltinsString::Pad(EcmaRuntimeCallInfo *argv, bool isStart)
|
|||||||
stringBuilder = u" ";
|
stringBuilder = u" ";
|
||||||
} else {
|
} else {
|
||||||
JSHandle<EcmaString> filler = JSTaggedValue::ToString(thread, fillString);
|
JSHandle<EcmaString> filler = JSTaggedValue::ToString(thread, fillString);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
stringBuilder = EcmaStringAccessor(filler).ToU16String();
|
stringBuilder = EcmaStringAccessor(filler).ToU16String();
|
||||||
}
|
}
|
||||||
if (stringBuilder.size() == 0) {
|
if (stringBuilder.size() == 0) {
|
||||||
|
@ -110,6 +110,7 @@ JSTaggedValue BuiltinsSymbol::SymbolDescriptiveString(JSThread *thread, JSTagged
|
|||||||
JSHandle<EcmaString> rightHandle(factory->NewFromASCII(")"));
|
JSHandle<EcmaString> rightHandle(factory->NewFromASCII(")"));
|
||||||
JSHandle<EcmaString> stringLeft =
|
JSHandle<EcmaString> stringLeft =
|
||||||
factory->ConcatFromString(leftHandle, JSTaggedValue::ToString(thread, descHandle));
|
factory->ConcatFromString(leftHandle, JSTaggedValue::ToString(thread, descHandle));
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
JSHandle<EcmaString> str = factory->ConcatFromString(stringLeft, rightHandle);
|
JSHandle<EcmaString> str = factory->ConcatFromString(stringLeft, rightHandle);
|
||||||
return str.GetTaggedValue();
|
return str.GetTaggedValue();
|
||||||
}
|
}
|
||||||
|
@ -337,6 +337,7 @@ JSTaggedValue BuiltinsTypedArray::Of(EcmaRuntimeCallInfo *argv)
|
|||||||
while (k < len) {
|
while (k < len) {
|
||||||
tKey.Update(JSTaggedValue(k));
|
tKey.Update(JSTaggedValue(k));
|
||||||
JSHandle<JSTaggedValue> kKey(JSTaggedValue::ToString(thread, tKey));
|
JSHandle<JSTaggedValue> kKey(JSTaggedValue::ToString(thread, tKey));
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
JSHandle<JSTaggedValue> kValue = GetCallArg(argv, k);
|
JSHandle<JSTaggedValue> kValue = GetCallArg(argv, k);
|
||||||
JSTaggedValue::SetProperty(thread, JSHandle<JSTaggedValue>::Cast(newObj), kKey, kValue, true);
|
JSTaggedValue::SetProperty(thread, JSHandle<JSTaggedValue>::Cast(newObj), kKey, kValue, true);
|
||||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
@ -1116,6 +1117,7 @@ JSTaggedValue BuiltinsTypedArray::Set(EcmaRuntimeCallInfo *argv)
|
|||||||
while (targetByteIndex < limit) {
|
while (targetByteIndex < limit) {
|
||||||
tKey.Update(JSTaggedValue(k));
|
tKey.Update(JSTaggedValue(k));
|
||||||
JSHandle<JSTaggedValue> kKey(JSTaggedValue::ToString(thread, tKey));
|
JSHandle<JSTaggedValue> kKey(JSTaggedValue::ToString(thread, tKey));
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
kValue.Update(ObjectFastOperator::FastGetPropertyByValue(
|
kValue.Update(ObjectFastOperator::FastGetPropertyByValue(
|
||||||
thread, JSHandle<JSTaggedValue>::Cast(src).GetTaggedValue(), kKey.GetTaggedValue()));
|
thread, JSHandle<JSTaggedValue>::Cast(src).GetTaggedValue(), kKey.GetTaggedValue()));
|
||||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
|
@ -107,6 +107,7 @@ JSTaggedValue BuiltinsWeakMap::Has(EcmaRuntimeCallInfo *argv)
|
|||||||
THROW_TYPE_ERROR_AND_RETURN(thread, "obj is not JSWeakMap.", JSTaggedValue::Exception());
|
THROW_TYPE_ERROR_AND_RETURN(thread, "obj is not JSWeakMap.", JSTaggedValue::Exception());
|
||||||
}
|
}
|
||||||
JSWeakMap *jsWeakMap = JSWeakMap::Cast(*JSTaggedValue::ToObject(thread, self));
|
JSWeakMap *jsWeakMap = JSWeakMap::Cast(*JSTaggedValue::ToObject(thread, self));
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
JSHandle<JSTaggedValue> key = GetCallArg(argv, 0);
|
JSHandle<JSTaggedValue> key = GetCallArg(argv, 0);
|
||||||
// 5.if Type(key) is not Object, return false.
|
// 5.if Type(key) is not Object, return false.
|
||||||
if (!key->IsHeapObject()) {
|
if (!key->IsHeapObject()) {
|
||||||
@ -128,6 +129,7 @@ JSTaggedValue BuiltinsWeakMap::Get(EcmaRuntimeCallInfo *argv)
|
|||||||
THROW_TYPE_ERROR_AND_RETURN(thread, "obj is not JSWeakMap.", JSTaggedValue::Exception());
|
THROW_TYPE_ERROR_AND_RETURN(thread, "obj is not JSWeakMap.", JSTaggedValue::Exception());
|
||||||
}
|
}
|
||||||
JSWeakMap *jsWeakMap = JSWeakMap::Cast(*JSTaggedValue::ToObject(thread, self));
|
JSWeakMap *jsWeakMap = JSWeakMap::Cast(*JSTaggedValue::ToObject(thread, self));
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
JSHandle<JSTaggedValue> key = GetCallArg(argv, 0);
|
JSHandle<JSTaggedValue> key = GetCallArg(argv, 0);
|
||||||
if (!key->IsHeapObject()) {
|
if (!key->IsHeapObject()) {
|
||||||
return JSTaggedValue::Undefined();
|
return JSTaggedValue::Undefined();
|
||||||
|
@ -128,7 +128,7 @@ JSTaggedValue BuiltinsWeakSet::Add(EcmaRuntimeCallInfo *argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
JSHandle<JSWeakSet> weakSet(thread, JSWeakSet::Cast(*JSTaggedValue::ToObject(thread, self)));
|
JSHandle<JSWeakSet> weakSet(thread, JSWeakSet::Cast(*JSTaggedValue::ToObject(thread, self)));
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
JSWeakSet::Add(thread, weakSet, value);
|
JSWeakSet::Add(thread, weakSet, value);
|
||||||
return weakSet.GetTaggedValue();
|
return weakSet.GetTaggedValue();
|
||||||
}
|
}
|
||||||
@ -147,6 +147,7 @@ JSTaggedValue BuiltinsWeakSet::Delete(EcmaRuntimeCallInfo *argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
JSHandle<JSWeakSet> weakSet(thread, JSWeakSet::Cast(*JSTaggedValue::ToObject(thread, self)));
|
JSHandle<JSWeakSet> weakSet(thread, JSWeakSet::Cast(*JSTaggedValue::ToObject(thread, self)));
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
JSHandle<JSTaggedValue> value = GetCallArg(argv, 0);
|
JSHandle<JSTaggedValue> value = GetCallArg(argv, 0);
|
||||||
if (!value->IsHeapObject()) {
|
if (!value->IsHeapObject()) {
|
||||||
GetTaggedBoolean(false);
|
GetTaggedBoolean(false);
|
||||||
@ -167,6 +168,7 @@ JSTaggedValue BuiltinsWeakSet::Has(EcmaRuntimeCallInfo *argv)
|
|||||||
THROW_TYPE_ERROR_AND_RETURN(thread, "obj is not JSWeakSet", JSTaggedValue::Exception());
|
THROW_TYPE_ERROR_AND_RETURN(thread, "obj is not JSWeakSet", JSTaggedValue::Exception());
|
||||||
}
|
}
|
||||||
JSWeakSet *jsWeakSet = JSWeakSet::Cast(*JSTaggedValue::ToObject(thread, self));
|
JSWeakSet *jsWeakSet = JSWeakSet::Cast(*JSTaggedValue::ToObject(thread, self));
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
JSHandle<JSTaggedValue> value = GetCallArg(argv, 0);
|
JSHandle<JSTaggedValue> value = GetCallArg(argv, 0);
|
||||||
if (!value->IsHeapObject()) {
|
if (!value->IsHeapObject()) {
|
||||||
GetTaggedBoolean(false);
|
GetTaggedBoolean(false);
|
||||||
|
@ -94,6 +94,7 @@ JSTaggedValue ContainersArrayList::Insert(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> index = GetCallArg(argv, 1);
|
JSHandle<JSTaggedValue> index = GetCallArg(argv, 1);
|
||||||
if (!index->IsInteger()) {
|
if (!index->IsInteger()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, index);
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, index);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg = "The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
CString errorMsg = "The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception());
|
THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception());
|
||||||
@ -218,6 +219,7 @@ JSTaggedValue ContainersArrayList::IncreaseCapacityTo(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> newCapacity = GetCallArg(argv, 0);
|
JSHandle<JSTaggedValue> newCapacity = GetCallArg(argv, 0);
|
||||||
if (!newCapacity->IsInteger()) {
|
if (!newCapacity->IsInteger()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, newCapacity);
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, newCapacity);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"newCapacity\" must be number. Received value is: " + ConvertToString(*result);
|
"The type of \"newCapacity\" must be number. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -366,6 +368,7 @@ JSTaggedValue ContainersArrayList::RemoveByIndex(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> value = GetCallArg(argv, 0);
|
JSHandle<JSTaggedValue> value = GetCallArg(argv, 0);
|
||||||
if (!value->IsInteger()) {
|
if (!value->IsInteger()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, value.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, value.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -429,6 +432,7 @@ JSTaggedValue ContainersArrayList::RemoveByRange(EcmaRuntimeCallInfo *argv)
|
|||||||
if (!startIndex->IsInteger()) {
|
if (!startIndex->IsInteger()) {
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, startIndex);
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, startIndex);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"fromIndex\" must be number. Received value is: " + ConvertToString(*result);
|
"The type of \"fromIndex\" must be number. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -437,6 +441,7 @@ JSTaggedValue ContainersArrayList::RemoveByRange(EcmaRuntimeCallInfo *argv)
|
|||||||
if (!endIndex->IsInteger()) {
|
if (!endIndex->IsInteger()) {
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, endIndex);
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, endIndex);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"toIndex\" must be number. Received value is: " + ConvertToString(*result);
|
"The type of \"toIndex\" must be number. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -470,6 +475,7 @@ JSTaggedValue ContainersArrayList::ReplaceAllElements(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> callbackFnHandle = GetCallArg(argv, 0);
|
JSHandle<JSTaggedValue> callbackFnHandle = GetCallArg(argv, 0);
|
||||||
if (!callbackFnHandle->IsCallable()) {
|
if (!callbackFnHandle->IsCallable()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, callbackFnHandle);
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, callbackFnHandle);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"callbackfn\" must be callable. Received value is: " + ConvertToString(*result);
|
"The type of \"callbackfn\" must be callable. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -528,6 +534,7 @@ JSTaggedValue ContainersArrayList::SubArrayList(EcmaRuntimeCallInfo *argv)
|
|||||||
if (!value1->IsInteger()) {
|
if (!value1->IsInteger()) {
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, value1);
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, value1);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"fromIndex\" must be number. Received value is: " + ConvertToString(*result);
|
"The type of \"fromIndex\" must be number. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -536,6 +543,7 @@ JSTaggedValue ContainersArrayList::SubArrayList(EcmaRuntimeCallInfo *argv)
|
|||||||
if (!value2->IsInteger()) {
|
if (!value2->IsInteger()) {
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, value2);
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, value2);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"toIndex\" must be number. Received value is: " + ConvertToString(*result);
|
"The type of \"toIndex\" must be number. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -567,6 +575,7 @@ JSTaggedValue ContainersArrayList::Sort(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> callbackFnHandle = GetCallArg(argv, 0);
|
JSHandle<JSTaggedValue> callbackFnHandle = GetCallArg(argv, 0);
|
||||||
if (!callbackFnHandle->IsUndefined() && !callbackFnHandle->IsCallable() && !callbackFnHandle->IsNull()) {
|
if (!callbackFnHandle->IsUndefined() && !callbackFnHandle->IsCallable() && !callbackFnHandle->IsNull()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, callbackFnHandle);
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, callbackFnHandle);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"comparator\" must be callable. Received value is: " + ConvertToString(*result);
|
"The type of \"comparator\" must be callable. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -677,6 +686,7 @@ JSTaggedValue ContainersArrayList::ForEach(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> callbackFnHandle = GetCallArg(argv, 0);
|
JSHandle<JSTaggedValue> callbackFnHandle = GetCallArg(argv, 0);
|
||||||
if (!callbackFnHandle->IsCallable()) {
|
if (!callbackFnHandle->IsCallable()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, callbackFnHandle);
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, callbackFnHandle);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"callbackfn\" must be callable. Received value is: " + ConvertToString(*result);
|
"The type of \"callbackfn\" must be callable. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
|
@ -237,6 +237,7 @@ JSTaggedValue ContainersDeque::ForEach(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> callbackFnHandle = GetCallArg(argv, 0);
|
JSHandle<JSTaggedValue> callbackFnHandle = GetCallArg(argv, 0);
|
||||||
if (!callbackFnHandle->IsCallable()) {
|
if (!callbackFnHandle->IsCallable()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, callbackFnHandle);
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, callbackFnHandle);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"callbackfn\" must be callable. Received value is: " + ConvertToString(*result);
|
"The type of \"callbackfn\" must be callable. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
|
@ -138,6 +138,7 @@ JSTaggedValue ContainersHashMap::ForEach(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> callbackFnHandle = GetCallArg(argv, 0);
|
JSHandle<JSTaggedValue> callbackFnHandle = GetCallArg(argv, 0);
|
||||||
if (!callbackFnHandle->IsCallable()) {
|
if (!callbackFnHandle->IsCallable()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, callbackFnHandle);
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, callbackFnHandle);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"callbackfn\" must be callable. Received value is: " + ConvertToString(*result);
|
"The type of \"callbackfn\" must be callable. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -218,6 +219,7 @@ JSTaggedValue ContainersHashMap::SetAll(EcmaRuntimeCallInfo *argv)
|
|||||||
obj = JSHandle<JSTaggedValue>(thread, JSHandle<JSProxy>::Cast(obj)->GetTarget());
|
obj = JSHandle<JSTaggedValue>(thread, JSHandle<JSProxy>::Cast(obj)->GetTarget());
|
||||||
} else {
|
} else {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, obj);
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, obj);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"map\" must be HashMap. Received value is: " + ConvertToString(*result);
|
"The type of \"map\" must be HashMap. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
|
@ -248,6 +248,7 @@ JSTaggedValue ContainersHashSet::ForEach(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> callbackFnHandle = GetCallArg(argv, 0);
|
JSHandle<JSTaggedValue> callbackFnHandle = GetCallArg(argv, 0);
|
||||||
if (!callbackFnHandle->IsCallable()) {
|
if (!callbackFnHandle->IsCallable()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, callbackFnHandle);
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, callbackFnHandle);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"callbackfn\" must be callable. Received value is: " + ConvertToString(*result);
|
"The type of \"callbackfn\" must be callable. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
|
@ -103,6 +103,7 @@ JSTaggedValue ContainersLightWeightMap::HasAll(EcmaRuntimeCallInfo *argv)
|
|||||||
lightWeightMap = JSHandle<JSTaggedValue>(thread, JSHandle<JSProxy>::Cast(lightWeightMap)->GetTarget());
|
lightWeightMap = JSHandle<JSTaggedValue>(thread, JSHandle<JSProxy>::Cast(lightWeightMap)->GetTarget());
|
||||||
} else {
|
} else {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, lightWeightMap.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, lightWeightMap.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"map\" must be LightWeightMap. Received value is: " + ConvertToString(*result);
|
"The type of \"map\" must be LightWeightMap. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -180,6 +181,7 @@ JSTaggedValue ContainersLightWeightMap::IncreaseCapacityTo(EcmaRuntimeCallInfo *
|
|||||||
|
|
||||||
if (!index->IsInt()) {
|
if (!index->IsInt()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, index);
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, index);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"minimumCapacity\" must be number. Received value is: " + ConvertToString(*result);
|
"The type of \"minimumCapacity\" must be number. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -317,6 +319,7 @@ JSTaggedValue ContainersLightWeightMap::GetKeyAt(EcmaRuntimeCallInfo *argv)
|
|||||||
|
|
||||||
if (!index->IsInt()) {
|
if (!index->IsInt()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, index);
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, index);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -365,6 +368,7 @@ JSTaggedValue ContainersLightWeightMap::SetAll(EcmaRuntimeCallInfo *argv)
|
|||||||
lightWeightMap = JSHandle<JSTaggedValue>(thread, JSHandle<JSProxy>::Cast(lightWeightMap)->GetTarget());
|
lightWeightMap = JSHandle<JSTaggedValue>(thread, JSHandle<JSProxy>::Cast(lightWeightMap)->GetTarget());
|
||||||
} else {
|
} else {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, lightWeightMap.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, lightWeightMap.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"map\" must be LightWeightMap. Received value is: " + ConvertToString(*result);
|
"The type of \"map\" must be LightWeightMap. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -445,6 +449,7 @@ JSTaggedValue ContainersLightWeightMap::RemoveAt(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> index(GetCallArg(argv, 0));
|
JSHandle<JSTaggedValue> index(GetCallArg(argv, 0));
|
||||||
if (!index->IsInt()) {
|
if (!index->IsInt()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, index);
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, index);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -499,6 +504,7 @@ JSTaggedValue ContainersLightWeightMap::SetValueAt(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> value(GetCallArg(argv, 1));
|
JSHandle<JSTaggedValue> value(GetCallArg(argv, 1));
|
||||||
if (!index->IsInt()) {
|
if (!index->IsInt()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, index);
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, index);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -530,6 +536,7 @@ JSTaggedValue ContainersLightWeightMap::ForEach(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> func(GetCallArg(argv, 0));
|
JSHandle<JSTaggedValue> func(GetCallArg(argv, 0));
|
||||||
if (!func->IsCallable()) {
|
if (!func->IsCallable()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, func.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, func.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"callbackfn\" must be callable. Received value is: " + ConvertToString(*result);
|
"The type of \"callbackfn\" must be callable. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -606,6 +613,7 @@ JSTaggedValue ContainersLightWeightMap::GetValueAt(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> index(GetCallArg(argv, 0));
|
JSHandle<JSTaggedValue> index(GetCallArg(argv, 0));
|
||||||
if (!index->IsInt()) {
|
if (!index->IsInt()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, index);
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, index);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
|
@ -96,6 +96,7 @@ JSTaggedValue ContainersLightWeightSet::AddAll(EcmaRuntimeCallInfo *argv)
|
|||||||
value = JSHandle<JSTaggedValue>(thread, JSHandle<JSProxy>::Cast(value)->GetTarget());
|
value = JSHandle<JSTaggedValue>(thread, JSHandle<JSProxy>::Cast(value)->GetTarget());
|
||||||
} else {
|
} else {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, value.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, value.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"set\" must be LightWeightSet. Received value is: " + ConvertToString(*result);
|
"The type of \"set\" must be LightWeightSet. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -145,6 +146,7 @@ JSTaggedValue ContainersLightWeightSet::GetValueAt(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> value(GetCallArg(argv, 0));
|
JSHandle<JSTaggedValue> value(GetCallArg(argv, 0));
|
||||||
if (!value->IsInteger()) {
|
if (!value->IsInteger()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, value.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, value.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -177,6 +179,7 @@ JSTaggedValue ContainersLightWeightSet::HasAll(EcmaRuntimeCallInfo *argv)
|
|||||||
value = JSHandle<JSTaggedValue>(thread, JSHandle<JSProxy>::Cast(value)->GetTarget());
|
value = JSHandle<JSTaggedValue>(thread, JSHandle<JSProxy>::Cast(value)->GetTarget());
|
||||||
} else {
|
} else {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, value.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, value.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"set\" must be LightWeightSet. Received value is: " + ConvertToString(*result);
|
"The type of \"set\" must be LightWeightSet. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -268,6 +271,7 @@ JSTaggedValue ContainersLightWeightSet::IncreaseCapacityTo(EcmaRuntimeCallInfo *
|
|||||||
JSHandle<JSTaggedValue> value(GetCallArg(argv, 0));
|
JSHandle<JSTaggedValue> value(GetCallArg(argv, 0));
|
||||||
if (!value->IsInteger()) {
|
if (!value->IsInteger()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, value.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, value.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"minimumCapacity\" must be number. Received value is: " + ConvertToString(*result);
|
"The type of \"minimumCapacity\" must be number. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -364,6 +368,7 @@ JSTaggedValue ContainersLightWeightSet::ForEach(EcmaRuntimeCallInfo *argv)
|
|||||||
|
|
||||||
if (!callbackFnHandle->IsCallable()) {
|
if (!callbackFnHandle->IsCallable()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, callbackFnHandle.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, callbackFnHandle.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"callbackfn\" must be callable. Received value is: " + ConvertToString(*result);
|
"The type of \"callbackfn\" must be callable. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -435,6 +440,7 @@ JSTaggedValue ContainersLightWeightSet::RemoveAt(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> value(GetCallArg(argv, 0));
|
JSHandle<JSTaggedValue> value(GetCallArg(argv, 0));
|
||||||
if (!value->IsInteger()) {
|
if (!value->IsInteger()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, value.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, value.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
|
@ -178,6 +178,7 @@ JSTaggedValue ContainersLinkedList::Insert(EcmaRuntimeCallInfo *argv)
|
|||||||
|
|
||||||
if (!index->IsInteger()) {
|
if (!index->IsInteger()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, index.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, index.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -275,6 +276,7 @@ JSTaggedValue ContainersLinkedList::Get(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> index = GetCallArg(argv, 0);
|
JSHandle<JSTaggedValue> index = GetCallArg(argv, 0);
|
||||||
if (!index->IsInteger()) {
|
if (!index->IsInteger()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, index.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, index.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -344,6 +346,7 @@ JSTaggedValue ContainersLinkedList::RemoveByIndex(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> index = GetCallArg(argv, 0);
|
JSHandle<JSTaggedValue> index = GetCallArg(argv, 0);
|
||||||
if (!index->IsInteger()) {
|
if (!index->IsInteger()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, index.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, index.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -488,6 +491,7 @@ JSTaggedValue ContainersLinkedList::Set(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> element = GetCallArg(argv, 1);
|
JSHandle<JSTaggedValue> element = GetCallArg(argv, 1);
|
||||||
if (!index->IsInteger()) {
|
if (!index->IsInteger()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, index.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, index.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -540,6 +544,7 @@ JSTaggedValue ContainersLinkedList::ForEach(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> callbackFnHandle(GetCallArg(argv, 0));
|
JSHandle<JSTaggedValue> callbackFnHandle(GetCallArg(argv, 0));
|
||||||
if (!callbackFnHandle->IsCallable()) {
|
if (!callbackFnHandle->IsCallable()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, callbackFnHandle.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, callbackFnHandle.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"callbackfn\" must be callable. Received value is: " + ConvertToString(*result);
|
"The type of \"callbackfn\" must be callable. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
|
@ -94,6 +94,7 @@ JSTaggedValue ContainersList::Insert(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> index = GetCallArg(argv, 1);
|
JSHandle<JSTaggedValue> index = GetCallArg(argv, 1);
|
||||||
if (!index->IsInteger()) {
|
if (!index->IsInteger()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, index.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, index.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -206,6 +207,7 @@ JSTaggedValue ContainersList::Get(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> index = GetCallArg(argv, 0);
|
JSHandle<JSTaggedValue> index = GetCallArg(argv, 0);
|
||||||
if (!index->IsInteger()) {
|
if (!index->IsInteger()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, index.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, index.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -276,6 +278,7 @@ JSTaggedValue ContainersList::Set(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> element = GetCallArg(argv, 1);
|
JSHandle<JSTaggedValue> element = GetCallArg(argv, 1);
|
||||||
if (!index->IsInteger()) {
|
if (!index->IsInteger()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, index.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, index.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -309,6 +312,7 @@ JSTaggedValue ContainersList::ForEach(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> callbackFnHandle(GetCallArg(argv, 0));
|
JSHandle<JSTaggedValue> callbackFnHandle(GetCallArg(argv, 0));
|
||||||
if (!callbackFnHandle->IsCallable()) {
|
if (!callbackFnHandle->IsCallable()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, callbackFnHandle.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, callbackFnHandle.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"callbackfn\" must be callable. Received value is: " + ConvertToString(*result);
|
"The type of \"callbackfn\" must be callable. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -379,6 +383,7 @@ JSTaggedValue ContainersList::RemoveByIndex(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> index = GetCallArg(argv, 0);
|
JSHandle<JSTaggedValue> index = GetCallArg(argv, 0);
|
||||||
if (!index->IsInteger()) {
|
if (!index->IsInteger()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, index.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, index.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -429,6 +434,7 @@ JSTaggedValue ContainersList::ReplaceAllElements(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> callbackFnHandle = GetCallArg(argv, 0);
|
JSHandle<JSTaggedValue> callbackFnHandle = GetCallArg(argv, 0);
|
||||||
if (!callbackFnHandle->IsCallable()) {
|
if (!callbackFnHandle->IsCallable()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, callbackFnHandle.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, callbackFnHandle.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"callbackfn\" must be callable. Received value is: " + ConvertToString(*result);
|
"The type of \"callbackfn\" must be callable. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -486,6 +492,7 @@ JSTaggedValue ContainersList::Sort(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> callbackFnHandle = GetCallArg(argv, 0);
|
JSHandle<JSTaggedValue> callbackFnHandle = GetCallArg(argv, 0);
|
||||||
if (!callbackFnHandle->IsUndefined() && !callbackFnHandle->IsCallable()) {
|
if (!callbackFnHandle->IsUndefined() && !callbackFnHandle->IsCallable()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, callbackFnHandle.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, callbackFnHandle.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"comparator\" must be callable. Received value is: " + ConvertToString(*result);
|
"The type of \"comparator\" must be callable. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -545,6 +552,7 @@ JSTaggedValue ContainersList::GetSubList(EcmaRuntimeCallInfo *argv)
|
|||||||
|
|
||||||
if (!fromIndex->IsInteger()) {
|
if (!fromIndex->IsInteger()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, fromIndex.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, fromIndex.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"fromIndex\" must be number. Received value is: " + ConvertToString(*result);
|
"The type of \"fromIndex\" must be number. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -555,6 +563,7 @@ JSTaggedValue ContainersList::GetSubList(EcmaRuntimeCallInfo *argv)
|
|||||||
|
|
||||||
if (!toIndex->IsInteger()) {
|
if (!toIndex->IsInteger()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, toIndex.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, toIndex.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"toIndex\" must be number. Received value is: " + ConvertToString(*result);
|
"The type of \"toIndex\" must be number. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
|
@ -70,6 +70,7 @@ JSTaggedValue ContainersPlainArray::Add(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> value(GetCallArg(argv, 1));
|
JSHandle<JSTaggedValue> value(GetCallArg(argv, 1));
|
||||||
if (!key->IsInteger()) {
|
if (!key->IsInteger()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, key.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, key.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"key\" must be number. Received value is: " + ConvertToString(*result);
|
"The type of \"key\" must be number. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -140,6 +141,7 @@ JSTaggedValue ContainersPlainArray::Has(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> value(GetCallArg(argv, 0));
|
JSHandle<JSTaggedValue> value(GetCallArg(argv, 0));
|
||||||
if (!value->IsNumber()) {
|
if (!value->IsNumber()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, value.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, value.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"key\" must be number. Received value is: " + ConvertToString(*result);
|
"The type of \"key\" must be number. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -170,6 +172,7 @@ JSTaggedValue ContainersPlainArray::Get(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> key(GetCallArg(argv, 0));
|
JSHandle<JSTaggedValue> key(GetCallArg(argv, 0));
|
||||||
if (!key->IsInteger()) {
|
if (!key->IsInteger()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, key.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, key.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"key\" must be number. Received value is: " + ConvertToString(*result);
|
"The type of \"key\" must be number. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -220,6 +223,7 @@ JSTaggedValue ContainersPlainArray::ForEach(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> callbackFnHandle = GetCallArg(argv, 0);
|
JSHandle<JSTaggedValue> callbackFnHandle = GetCallArg(argv, 0);
|
||||||
if (!callbackFnHandle->IsCallable()) {
|
if (!callbackFnHandle->IsCallable()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, callbackFnHandle.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, callbackFnHandle.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"callbackfn\" must be callable. Received value is: " + ConvertToString(*result);
|
"The type of \"callbackfn\" must be callable. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -266,6 +270,7 @@ JSTaggedValue ContainersPlainArray::GetIndexOfKey(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> value(GetCallArg(argv, 0));
|
JSHandle<JSTaggedValue> value(GetCallArg(argv, 0));
|
||||||
if (!value->IsNumber()) {
|
if (!value->IsNumber()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, value.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, value.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"key\" must be number. Received value is: " + ConvertToString(*result);
|
"The type of \"key\" must be number. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -336,6 +341,7 @@ JSTaggedValue ContainersPlainArray::GetKeyAt(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> value(GetCallArg(argv, 0));
|
JSHandle<JSTaggedValue> value(GetCallArg(argv, 0));
|
||||||
if (!value->IsNumber()) {
|
if (!value->IsNumber()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, value.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, value.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -365,6 +371,7 @@ JSTaggedValue ContainersPlainArray::Remove(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> key(GetCallArg(argv, 0));
|
JSHandle<JSTaggedValue> key(GetCallArg(argv, 0));
|
||||||
if (!key->IsInteger()) {
|
if (!key->IsInteger()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, key.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, key.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"key\" must be number. Received value is: " + ConvertToString(*result);
|
"The type of \"key\" must be number. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -393,6 +400,7 @@ JSTaggedValue ContainersPlainArray::RemoveAt(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> index(GetCallArg(argv, 0));
|
JSHandle<JSTaggedValue> index(GetCallArg(argv, 0));
|
||||||
if (!index->IsInteger()) {
|
if (!index->IsInteger()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, index.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, index.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -422,6 +430,7 @@ JSTaggedValue ContainersPlainArray::RemoveRangeFrom(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> valueSize(GetCallArg(argv, 1));
|
JSHandle<JSTaggedValue> valueSize(GetCallArg(argv, 1));
|
||||||
if (!valueIndex->IsInteger()) {
|
if (!valueIndex->IsInteger()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, valueIndex.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, valueIndex.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -429,6 +438,7 @@ JSTaggedValue ContainersPlainArray::RemoveRangeFrom(EcmaRuntimeCallInfo *argv)
|
|||||||
}
|
}
|
||||||
if (!valueSize->IsInteger()) {
|
if (!valueSize->IsInteger()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, valueSize.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, valueSize.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"size\" must be number. Received value is: " + ConvertToString(*result);
|
"The type of \"size\" must be number. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -461,6 +471,7 @@ JSTaggedValue ContainersPlainArray::SetValueAt(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> value(GetCallArg(argv, 1));
|
JSHandle<JSTaggedValue> value(GetCallArg(argv, 1));
|
||||||
if (!index->IsInteger()) {
|
if (!index->IsInteger()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, index.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, index.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -490,6 +501,7 @@ JSTaggedValue ContainersPlainArray::GetValueAt(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> idx(GetCallArg(argv, 0));
|
JSHandle<JSTaggedValue> idx(GetCallArg(argv, 0));
|
||||||
if (!idx->IsInteger()) {
|
if (!idx->IsInteger()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, idx.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, idx.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
"The type of \"index\" must be number. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
|
@ -144,6 +144,7 @@ JSTaggedValue ContainersQueue::ForEach(EcmaRuntimeCallInfo *argv)
|
|||||||
// If IsCallable(callbackfn) is false, throw a TypeError exception.
|
// If IsCallable(callbackfn) is false, throw a TypeError exception.
|
||||||
if (!callbackFnHandle->IsCallable()) {
|
if (!callbackFnHandle->IsCallable()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, callbackFnHandle.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, callbackFnHandle.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"callbackfn\" must be callable. Received value is: " + ConvertToString(*result);
|
"The type of \"callbackfn\" must be callable. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
|
@ -192,6 +192,7 @@ JSTaggedValue ContainersStack::ForEach(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> callbackFnHandle = GetCallArg(argv, 0);
|
JSHandle<JSTaggedValue> callbackFnHandle = GetCallArg(argv, 0);
|
||||||
if (!callbackFnHandle->IsCallable()) {
|
if (!callbackFnHandle->IsCallable()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, callbackFnHandle.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, callbackFnHandle.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"callbackfn\" must be callable. Received value is: " + ConvertToString(*result);
|
"The type of \"callbackfn\" must be callable. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
|
@ -58,6 +58,7 @@ JSTaggedValue ContainersTreeMap::TreeMapConstructor(EcmaRuntimeCallInfo *argv)
|
|||||||
}
|
}
|
||||||
if (!compareFn->IsCallable()) {
|
if (!compareFn->IsCallable()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, compareFn.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, compareFn.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"comparefn\" must be callable. Received value is: " + ConvertToString(*result);
|
"The type of \"comparefn\" must be callable. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -252,6 +253,7 @@ JSTaggedValue ContainersTreeMap::SetAll(EcmaRuntimeCallInfo *argv)
|
|||||||
obj = JSHandle<JSTaggedValue>(thread, JSHandle<JSProxy>::Cast(obj)->GetTarget());
|
obj = JSHandle<JSTaggedValue>(thread, JSHandle<JSProxy>::Cast(obj)->GetTarget());
|
||||||
} else {
|
} else {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, obj.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, obj.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"map\" must be TreeMap. Received value is: " + ConvertToString(*result);
|
"The type of \"map\" must be TreeMap. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -415,6 +417,7 @@ JSTaggedValue ContainersTreeMap::ForEach(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> func(GetCallArg(argv, 0));
|
JSHandle<JSTaggedValue> func(GetCallArg(argv, 0));
|
||||||
if (!func->IsCallable()) {
|
if (!func->IsCallable()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, func.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, func.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"callbackfn\" must be callable. Received value is: " + ConvertToString(*result);
|
"The type of \"callbackfn\" must be callable. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
|
@ -57,6 +57,7 @@ JSTaggedValue ContainersTreeSet::TreeSetConstructor(EcmaRuntimeCallInfo *argv)
|
|||||||
}
|
}
|
||||||
if (!compareFn->IsCallable()) {
|
if (!compareFn->IsCallable()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, compareFn.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, compareFn.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"comparefn\" must be callable. Received value is: " + ConvertToString(*result);
|
"The type of \"comparefn\" must be callable. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -223,6 +224,7 @@ JSTaggedValue ContainersTreeSet::GetLowerValue(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> key = GetCallArg(argv, 0);
|
JSHandle<JSTaggedValue> key = GetCallArg(argv, 0);
|
||||||
if (!key->IsString() && !key->IsNumber()) {
|
if (!key->IsString() && !key->IsNumber()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, key.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, key.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"key\" must be not null. Received value is: " + ConvertToString(*result);
|
"The type of \"key\" must be not null. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -253,6 +255,7 @@ JSTaggedValue ContainersTreeSet::GetHigherValue(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> key = GetCallArg(argv, 0);
|
JSHandle<JSTaggedValue> key = GetCallArg(argv, 0);
|
||||||
if (!key->IsString() && !key->IsNumber()) {
|
if (!key->IsString() && !key->IsNumber()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, key.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, key.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"key\" must be not null. Received value is: " + ConvertToString(*result);
|
"The type of \"key\" must be not null. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -365,6 +368,7 @@ JSTaggedValue ContainersTreeSet::ForEach(EcmaRuntimeCallInfo *argv)
|
|||||||
JSHandle<JSTaggedValue> func(GetCallArg(argv, 0));
|
JSHandle<JSTaggedValue> func(GetCallArg(argv, 0));
|
||||||
if (!func->IsCallable()) {
|
if (!func->IsCallable()) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, func.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, func.GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"callbackfn\" must be callable. Received value is: " + ConvertToString(*result);
|
"The type of \"callbackfn\" must be callable. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
|
@ -77,10 +77,12 @@ public:
|
|||||||
if (left.IsString()) {
|
if (left.IsString()) {
|
||||||
JSHandle<EcmaString> stringA0 = JSHandle<EcmaString>(leftValue);
|
JSHandle<EcmaString> stringA0 = JSHandle<EcmaString>(leftValue);
|
||||||
JSHandle<EcmaString> stringA1 = JSTaggedValue::ToString(thread, rightValue);
|
JSHandle<EcmaString> stringA1 = JSTaggedValue::ToString(thread, rightValue);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
EcmaString *ret = EcmaStringAccessor::Concat(thread->GetEcmaVM(), stringA0, stringA1);
|
EcmaString *ret = EcmaStringAccessor::Concat(thread->GetEcmaVM(), stringA0, stringA1);
|
||||||
return JSTaggedValue(ret);
|
return JSTaggedValue(ret);
|
||||||
} else {
|
} else {
|
||||||
JSHandle<EcmaString> stringA0 = JSTaggedValue::ToString(thread, leftValue);
|
JSHandle<EcmaString> stringA0 = JSTaggedValue::ToString(thread, leftValue);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
JSHandle<EcmaString> stringA1 = JSHandle<EcmaString>(rightValue);
|
JSHandle<EcmaString> stringA1 = JSHandle<EcmaString>(rightValue);
|
||||||
EcmaString *ret = EcmaStringAccessor::Concat(thread->GetEcmaVM(), stringA0, stringA1);
|
EcmaString *ret = EcmaStringAccessor::Concat(thread->GetEcmaVM(), stringA0, stringA1);
|
||||||
return JSTaggedValue(ret);
|
return JSTaggedValue(ret);
|
||||||
|
@ -405,6 +405,7 @@ bool JSAPIArrayList::GetOwnProperty(JSThread *thread, const JSHandle<JSAPIArrayL
|
|||||||
uint32_t index = 0;
|
uint32_t index = 0;
|
||||||
if (UNLIKELY(!JSTaggedValue::ToElementIndex(key.GetTaggedValue(), &index))) {
|
if (UNLIKELY(!JSTaggedValue::ToElementIndex(key.GetTaggedValue(), &index))) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, key.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, key.GetTaggedValue());
|
||||||
|
RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"index\" can not obtain attributes of no-number type. Received value is: "
|
"The type of \"index\" can not obtain attributes of no-number type. Received value is: "
|
||||||
+ ConvertToString(*result);
|
+ ConvertToString(*result);
|
||||||
|
@ -242,6 +242,7 @@ bool JSAPIDeque::GetOwnProperty(JSThread *thread, const JSHandle<JSAPIDeque> &de
|
|||||||
uint32_t index = 0;
|
uint32_t index = 0;
|
||||||
if (UNLIKELY(!JSTaggedValue::ToElementIndex(key.GetTaggedValue(), &index))) {
|
if (UNLIKELY(!JSTaggedValue::ToElementIndex(key.GetTaggedValue(), &index))) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, key.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, key.GetTaggedValue());
|
||||||
|
RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"key\" can not obtain attributes of no-number type. Received value is: "
|
"The type of \"key\" can not obtain attributes of no-number type. Received value is: "
|
||||||
+ ConvertToString(*result);
|
+ ConvertToString(*result);
|
||||||
|
@ -32,6 +32,7 @@ JSTaggedValue JSAPIHashSet::Has(JSThread *thread, JSTaggedValue value)
|
|||||||
{
|
{
|
||||||
if (!TaggedHashArray::IsKey(value)) {
|
if (!TaggedHashArray::IsKey(value)) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, value);
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, value);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"value\" must be Key of JS. Received value is: " + ConvertToString(*result);
|
"The type of \"value\" must be Key of JS. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
@ -80,6 +81,7 @@ JSTaggedValue JSAPIHashSet::Remove(JSThread *thread, JSHandle<JSAPIHashSet> hash
|
|||||||
{
|
{
|
||||||
if (!TaggedHashArray::IsKey(key)) {
|
if (!TaggedHashArray::IsKey(key)) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, key);
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, key);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"key\" must be not null. Received value is: " + ConvertToString(*result);
|
"The type of \"key\" must be not null. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
|
@ -234,6 +234,7 @@ bool JSAPILinkedList::GetOwnProperty(JSThread *thread, const JSHandle<JSAPILinke
|
|||||||
uint32_t index = 0;
|
uint32_t index = 0;
|
||||||
if (UNLIKELY(!JSTaggedValue::ToElementIndex(key.GetTaggedValue(), &index))) {
|
if (UNLIKELY(!JSTaggedValue::ToElementIndex(key.GetTaggedValue(), &index))) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, key.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, key.GetTaggedValue());
|
||||||
|
RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"index\" can not obtain attributes of no-number type. Received value is: "
|
"The type of \"index\" can not obtain attributes of no-number type. Received value is: "
|
||||||
+ ConvertToString(*result);
|
+ ConvertToString(*result);
|
||||||
|
@ -218,6 +218,7 @@ bool JSAPIList::GetOwnProperty(JSThread *thread, const JSHandle<JSAPIList> &list
|
|||||||
uint32_t index = 0;
|
uint32_t index = 0;
|
||||||
if (UNLIKELY(!JSTaggedValue::ToElementIndex(key.GetTaggedValue(), &index))) {
|
if (UNLIKELY(!JSTaggedValue::ToElementIndex(key.GetTaggedValue(), &index))) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, key.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, key.GetTaggedValue());
|
||||||
|
RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"index\" can not obtain attributes of no-number type. Received value is: "
|
"The type of \"index\" can not obtain attributes of no-number type. Received value is: "
|
||||||
+ ConvertToString(*result);
|
+ ConvertToString(*result);
|
||||||
|
@ -197,6 +197,7 @@ bool JSAPIQueue::GetOwnProperty(JSThread *thread, const JSHandle<JSAPIQueue> &ob
|
|||||||
uint32_t index = 0;
|
uint32_t index = 0;
|
||||||
if (UNLIKELY(!JSTaggedValue::ToElementIndex(key.GetTaggedValue(), &index))) {
|
if (UNLIKELY(!JSTaggedValue::ToElementIndex(key.GetTaggedValue(), &index))) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, key.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, key.GetTaggedValue());
|
||||||
|
RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"index\" can not obtain attributes of no-number type. Received value is: "
|
"The type of \"index\" can not obtain attributes of no-number type. Received value is: "
|
||||||
+ ConvertToString(*result);
|
+ ConvertToString(*result);
|
||||||
|
@ -142,6 +142,7 @@ bool JSAPIStack::GetOwnProperty(JSThread *thread, const JSHandle<JSAPIStack> &ob
|
|||||||
uint32_t index = 0;
|
uint32_t index = 0;
|
||||||
if (UNLIKELY(!JSTaggedValue::ToElementIndex(key.GetTaggedValue(), &index))) {
|
if (UNLIKELY(!JSTaggedValue::ToElementIndex(key.GetTaggedValue(), &index))) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, key.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, key.GetTaggedValue());
|
||||||
|
RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"index\" can not obtain attributes of no-number type. Received value is: "
|
"The type of \"index\" can not obtain attributes of no-number type. Received value is: "
|
||||||
+ ConvertToString(*result);
|
+ ConvertToString(*result);
|
||||||
|
@ -27,6 +27,7 @@ void JSAPITreeMap::Set(JSThread *thread, const JSHandle<JSAPITreeMap> &map, cons
|
|||||||
{
|
{
|
||||||
if (!TaggedTreeMap::IsKey(key.GetTaggedValue())) {
|
if (!TaggedTreeMap::IsKey(key.GetTaggedValue())) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, key.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, key.GetTaggedValue());
|
||||||
|
RETURN_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"key\" must be not null. Received value is: " + ConvertToString(*result);
|
"The type of \"key\" must be not null. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
|
@ -26,6 +26,7 @@ void JSAPITreeSet::Add(JSThread *thread, const JSHandle<JSAPITreeSet> &set, cons
|
|||||||
{
|
{
|
||||||
if (!TaggedTreeSet::IsKey(value.GetTaggedValue())) {
|
if (!TaggedTreeSet::IsKey(value.GetTaggedValue())) {
|
||||||
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, value.GetTaggedValue());
|
JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, value.GetTaggedValue());
|
||||||
|
RETURN_IF_ABRUPT_COMPLETION(thread);
|
||||||
CString errorMsg =
|
CString errorMsg =
|
||||||
"The type of \"value\" must be Key of JS. Received value is: " + ConvertToString(*result);
|
"The type of \"value\" must be Key of JS. Received value is: " + ConvertToString(*result);
|
||||||
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
|
||||||
|
@ -45,6 +45,7 @@ JSHandle<JSTaggedValue> JSAsyncFromSyncIterator::CreateAsyncFromSyncIterator(JST
|
|||||||
JSHandle<JSTaggedValue> nextStr = thread->GlobalConstants()->GetHandledNextString();
|
JSHandle<JSTaggedValue> nextStr = thread->GlobalConstants()->GetHandledNextString();
|
||||||
JSHandle<JSTaggedValue> tmpAsyncIterator(thread, asyncIterator.GetTaggedValue());
|
JSHandle<JSTaggedValue> tmpAsyncIterator(thread, asyncIterator.GetTaggedValue());
|
||||||
JSHandle<JSTaggedValue> nextMethod = JSTaggedValue::GetProperty(thread, tmpAsyncIterator, nextStr).GetValue();
|
JSHandle<JSTaggedValue> nextMethod = JSTaggedValue::GetProperty(thread, tmpAsyncIterator, nextStr).GetValue();
|
||||||
|
RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSTaggedValue, thread);
|
||||||
|
|
||||||
// 4.Let iteratorRecord be the Record {[[Iterator]]: asyncIterator, [[NextMethod]]: nextMethod, [[Done]]: false}.
|
// 4.Let iteratorRecord be the Record {[[Iterator]]: asyncIterator, [[NextMethod]]: nextMethod, [[Done]]: false}.
|
||||||
JSHandle<AsyncIteratorRecord> iteratorRecord = factory->NewAsyncIteratorRecord(tmpAsyncIterator, nextMethod, false);
|
JSHandle<AsyncIteratorRecord> iteratorRecord = factory->NewAsyncIteratorRecord(tmpAsyncIterator, nextMethod, false);
|
||||||
|
@ -100,10 +100,12 @@ void JSAsyncFunction::AsyncFunctionAwait(JSThread *thread, const JSHandle<JSTagg
|
|||||||
JSHandle<JSTaggedValue> asyncCtxt;
|
JSHandle<JSTaggedValue> asyncCtxt;
|
||||||
if (asyncFuncObj->IsAsyncGeneratorObject()) {
|
if (asyncFuncObj->IsAsyncGeneratorObject()) {
|
||||||
JSHandle<JSObject> obj = JSTaggedValue::ToObject(thread, asyncFuncObj);
|
JSHandle<JSObject> obj = JSTaggedValue::ToObject(thread, asyncFuncObj);
|
||||||
|
RETURN_IF_ABRUPT_COMPLETION(thread);
|
||||||
JSHandle<JSAsyncGeneratorObject> asyncGen = JSHandle<JSAsyncGeneratorObject>::Cast(obj);
|
JSHandle<JSAsyncGeneratorObject> asyncGen = JSHandle<JSAsyncGeneratorObject>::Cast(obj);
|
||||||
asyncCtxt = JSHandle<JSTaggedValue>(thread, asyncGen->GetGeneratorContext());
|
asyncCtxt = JSHandle<JSTaggedValue>(thread, asyncGen->GetGeneratorContext());
|
||||||
} else {
|
} else {
|
||||||
JSHandle<JSObject> obj = JSTaggedValue::ToObject(thread, asyncFuncObj);
|
JSHandle<JSObject> obj = JSTaggedValue::ToObject(thread, asyncFuncObj);
|
||||||
|
RETURN_IF_ABRUPT_COMPLETION(thread);
|
||||||
JSHandle<JSAsyncFuncObject> asyncFun = JSHandle<JSAsyncFuncObject>::Cast(obj);
|
JSHandle<JSAsyncFuncObject> asyncFun = JSHandle<JSAsyncFuncObject>::Cast(obj);
|
||||||
asyncCtxt = JSHandle<JSTaggedValue>(thread, asyncFun->GetGeneratorContext());
|
asyncCtxt = JSHandle<JSTaggedValue>(thread, asyncFun->GetGeneratorContext());
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,7 @@ void JSAsyncGeneratorObject::AsyncGeneratorValidate(JSThread *thread, const JSHa
|
|||||||
}
|
}
|
||||||
// 4. If generator.[[GeneratorBrand]] is not the same value as generatorBrand, throw a TypeError exception.
|
// 4. If generator.[[GeneratorBrand]] is not the same value as generatorBrand, throw a TypeError exception.
|
||||||
JSHandle<JSObject> obj = JSTaggedValue::ToObject(thread, gen);
|
JSHandle<JSObject> obj = JSTaggedValue::ToObject(thread, gen);
|
||||||
|
RETURN_IF_ABRUPT_COMPLETION(thread);
|
||||||
JSHandle<JSAsyncGeneratorObject> generator = JSHandle<JSAsyncGeneratorObject>::Cast(obj);
|
JSHandle<JSAsyncGeneratorObject> generator = JSHandle<JSAsyncGeneratorObject>::Cast(obj);
|
||||||
if (!JSTaggedValue::SameValue(generator->GetGeneratorBrand(), val)) {
|
if (!JSTaggedValue::SameValue(generator->GetGeneratorBrand(), val)) {
|
||||||
THROW_TYPE_ERROR(thread, "Results are not equal");
|
THROW_TYPE_ERROR(thread, "Results are not equal");
|
||||||
@ -271,6 +272,7 @@ JSTaggedValue JSAsyncGeneratorObject::AsyncGeneratorEnqueue(JSThread *thread, co
|
|||||||
}
|
}
|
||||||
// 4. Let queue be generator.[[AsyncGeneratorQueue]].
|
// 4. Let queue be generator.[[AsyncGeneratorQueue]].
|
||||||
JSHandle<JSObject> obj = JSTaggedValue::ToObject(thread, gen);
|
JSHandle<JSObject> obj = JSTaggedValue::ToObject(thread, gen);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
JSHandle<JSAsyncGeneratorObject> generator = JSHandle<JSAsyncGeneratorObject>::Cast(obj);
|
JSHandle<JSAsyncGeneratorObject> generator = JSHandle<JSAsyncGeneratorObject>::Cast(obj);
|
||||||
JSHandle<TaggedQueue> queue(thread, generator->GetAsyncGeneratorQueue());
|
JSHandle<TaggedQueue> queue(thread, generator->GetAsyncGeneratorQueue());
|
||||||
// 5. Let request be AsyncGeneratorRequest { [[Completion]]: completion, [[Capability]]: promiseCapability }.
|
// 5. Let request be AsyncGeneratorRequest { [[Completion]]: completion, [[Capability]]: promiseCapability }.
|
||||||
|
@ -238,6 +238,7 @@ bool JSFunction::MakeConstructor(JSThread *thread, const JSHandle<JSFunction> &f
|
|||||||
PropertyDescriptor constructorDesc(thread, JSHandle<JSTaggedValue>::Cast(func), writable, false, true);
|
PropertyDescriptor constructorDesc(thread, JSHandle<JSTaggedValue>::Cast(func), writable, false, true);
|
||||||
status = JSTaggedValue::DefinePropertyOrThrow(thread, proto, constructorKey, constructorDesc);
|
status = JSTaggedValue::DefinePropertyOrThrow(thread, proto, constructorKey, constructorDesc);
|
||||||
}
|
}
|
||||||
|
RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
|
||||||
|
|
||||||
ASSERT_PRINT(status, "DefineProperty construct failed");
|
ASSERT_PRINT(status, "DefineProperty construct failed");
|
||||||
// func.prototype = proto
|
// func.prototype = proto
|
||||||
|
@ -88,6 +88,7 @@ JSHandle<JSTaggedValue> JSIterator::GetAsyncIterator(JSThread *thread, const JSH
|
|||||||
JSHandle<JSTaggedValue> syncIterator = GetIterator(thread, obj, func);
|
JSHandle<JSTaggedValue> syncIterator = GetIterator(thread, obj, func);
|
||||||
JSHandle<JSTaggedValue> nextStr = thread->GlobalConstants()->GetHandledNextString();
|
JSHandle<JSTaggedValue> nextStr = thread->GlobalConstants()->GetHandledNextString();
|
||||||
JSHandle<JSTaggedValue> nextMethod = JSTaggedValue::GetProperty(thread, syncIterator, nextStr).GetValue();
|
JSHandle<JSTaggedValue> nextMethod = JSTaggedValue::GetProperty(thread, syncIterator, nextStr).GetValue();
|
||||||
|
RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSTaggedValue, thread);
|
||||||
JSHandle<AsyncIteratorRecord> syncIteratorRecord =
|
JSHandle<AsyncIteratorRecord> syncIteratorRecord =
|
||||||
factory->NewAsyncIteratorRecord(syncIterator, nextMethod, false);
|
factory->NewAsyncIteratorRecord(syncIterator, nextMethod, false);
|
||||||
JSHandle<JSTaggedValue> asyncIterator =
|
JSHandle<JSTaggedValue> asyncIterator =
|
||||||
@ -206,6 +207,7 @@ JSHandle<JSTaggedValue> JSIterator::IteratorValue(JSThread *thread, const JSHand
|
|||||||
// Return Get(iterResult, "value").
|
// Return Get(iterResult, "value").
|
||||||
JSHandle<JSTaggedValue> valueStr = thread->GlobalConstants()->GetHandledValueString();
|
JSHandle<JSTaggedValue> valueStr = thread->GlobalConstants()->GetHandledValueString();
|
||||||
JSHandle<JSTaggedValue> value = JSTaggedValue::GetProperty(thread, iterResult, valueStr).GetValue();
|
JSHandle<JSTaggedValue> value = JSTaggedValue::GetProperty(thread, iterResult, valueStr).GetValue();
|
||||||
|
RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSTaggedValue, thread);
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
// 7.4.5
|
// 7.4.5
|
||||||
|
@ -647,6 +647,7 @@ JSHandle<JSObject> JSLocale::PutElement(JSThread *thread, int index, const JSHan
|
|||||||
|
|
||||||
JSTaggedValue::SetProperty(thread, JSHandle<JSTaggedValue>::Cast(array), index,
|
JSTaggedValue::SetProperty(thread, JSHandle<JSTaggedValue>::Cast(array), index,
|
||||||
JSHandle<JSTaggedValue>::Cast(record), true);
|
JSHandle<JSTaggedValue>::Cast(record), true);
|
||||||
|
RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSObject, thread);
|
||||||
return record;
|
return record;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -524,15 +524,19 @@ public:
|
|||||||
// 6. Let mnfd be ? Get(options, "minimumFractionDigits").
|
// 6. Let mnfd be ? Get(options, "minimumFractionDigits").
|
||||||
JSHandle<JSTaggedValue> mnfdKey = globalConst->GetHandledMinimumFractionDigitsString();
|
JSHandle<JSTaggedValue> mnfdKey = globalConst->GetHandledMinimumFractionDigitsString();
|
||||||
JSHandle<JSTaggedValue> mnfd = JSTaggedValue::GetProperty(thread, options, mnfdKey).GetValue();
|
JSHandle<JSTaggedValue> mnfd = JSTaggedValue::GetProperty(thread, options, mnfdKey).GetValue();
|
||||||
|
RETURN_IF_ABRUPT_COMPLETION(thread);
|
||||||
// 7. Let mxfd be ? Get(options, "maximumFractionDigits").
|
// 7. Let mxfd be ? Get(options, "maximumFractionDigits").
|
||||||
JSHandle<JSTaggedValue> mxfdKey = globalConst->GetHandledMaximumFractionDigitsString();
|
JSHandle<JSTaggedValue> mxfdKey = globalConst->GetHandledMaximumFractionDigitsString();
|
||||||
JSHandle<JSTaggedValue> mxfd = JSTaggedValue::GetProperty(thread, options, mxfdKey).GetValue();
|
JSHandle<JSTaggedValue> mxfd = JSTaggedValue::GetProperty(thread, options, mxfdKey).GetValue();
|
||||||
|
RETURN_IF_ABRUPT_COMPLETION(thread);
|
||||||
// 8. Let mnsd be ? Get(options, "minimumSignificantDigits").
|
// 8. Let mnsd be ? Get(options, "minimumSignificantDigits").
|
||||||
JSHandle<JSTaggedValue> mnsdKey = globalConst->GetHandledMinimumSignificantDigitsString();
|
JSHandle<JSTaggedValue> mnsdKey = globalConst->GetHandledMinimumSignificantDigitsString();
|
||||||
JSHandle<JSTaggedValue> mnsd = JSTaggedValue::GetProperty(thread, options, mnsdKey).GetValue();
|
JSHandle<JSTaggedValue> mnsd = JSTaggedValue::GetProperty(thread, options, mnsdKey).GetValue();
|
||||||
|
RETURN_IF_ABRUPT_COMPLETION(thread);
|
||||||
// 9. Let mxsd be ? Get(options, "maximumSignificantDigits").
|
// 9. Let mxsd be ? Get(options, "maximumSignificantDigits").
|
||||||
JSHandle<JSTaggedValue> mxsdKey = globalConst->GetHandledMaximumSignificantDigitsString();
|
JSHandle<JSTaggedValue> mxsdKey = globalConst->GetHandledMaximumSignificantDigitsString();
|
||||||
JSHandle<JSTaggedValue> mxsd = JSTaggedValue::GetProperty(thread, options, mxsdKey).GetValue();
|
JSHandle<JSTaggedValue> mxsd = JSTaggedValue::GetProperty(thread, options, mxsdKey).GetValue();
|
||||||
|
RETURN_IF_ABRUPT_COMPLETION(thread);
|
||||||
|
|
||||||
// 10. Set intlObj.[[MinimumIntegerDigits]] to mnid.
|
// 10. Set intlObj.[[MinimumIntegerDigits]] to mnid.
|
||||||
intlObj->SetMinimumIntegerDigits(thread, JSTaggedValue(mnid));
|
intlObj->SetMinimumIntegerDigits(thread, JSTaggedValue(mnid));
|
||||||
|
@ -533,6 +533,7 @@ JSHandle<TaggedArray> JSObject::GetEnumElementKeys(JSThread *thread, const JSHan
|
|||||||
for (uint32_t i = static_cast<uint32_t>(offset); i < elementIndex; ++i) {
|
for (uint32_t i = static_cast<uint32_t>(offset); i < elementIndex; ++i) {
|
||||||
keyHandle.Update(JSTaggedValue(i));
|
keyHandle.Update(JSTaggedValue(i));
|
||||||
auto key = JSTaggedValue::ToString(thread, keyHandle);
|
auto key = JSTaggedValue::ToString(thread, keyHandle);
|
||||||
|
RETURN_HANDLE_IF_ABRUPT_COMPLETION(TaggedArray, thread);
|
||||||
elementArray->Set(thread, i, key);
|
elementArray->Set(thread, i, key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,7 @@ JSHandle<JSPrimitiveRef> JSPrimitiveRef::StringCreate(JSThread *thread, const JS
|
|||||||
// [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }).
|
// [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }).
|
||||||
PropertyDescriptor desc(thread, JSHandle<JSTaggedValue>(thread, JSTaggedValue(length)), false, false, false);
|
PropertyDescriptor desc(thread, JSHandle<JSTaggedValue>(thread, JSTaggedValue(length)), false, false, false);
|
||||||
[[maybe_unused]] bool status = JSTaggedValue::DefinePropertyOrThrow(thread, str, lengthStr, desc);
|
[[maybe_unused]] bool status = JSTaggedValue::DefinePropertyOrThrow(thread, str, lengthStr, desc);
|
||||||
|
RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSPrimitiveRef, thread);
|
||||||
ASSERT(status);
|
ASSERT(status);
|
||||||
// 9. Return S.
|
// 9. Return S.
|
||||||
return JSHandle<JSPrimitiveRef>(str);
|
return JSHandle<JSPrimitiveRef>(str);
|
||||||
|
@ -124,6 +124,7 @@ JSTaggedValue JSStableArray::Splice(JSHandle<JSArray> receiver, EcmaRuntimeCallI
|
|||||||
toKey.Update(JSTaggedValue(k));
|
toKey.Update(JSTaggedValue(k));
|
||||||
if (newArrayHandle->IsJSProxy()) {
|
if (newArrayHandle->IsJSProxy()) {
|
||||||
toKey.Update(JSTaggedValue::ToString(thread, toKey).GetTaggedValue());
|
toKey.Update(JSTaggedValue::ToString(thread, toKey).GetTaggedValue());
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
}
|
}
|
||||||
JSObject::CreateDataPropertyOrThrow(thread, newArrayHandle, toKey, fromValue);
|
JSObject::CreateDataPropertyOrThrow(thread, newArrayHandle, toKey, fromValue);
|
||||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
@ -581,11 +582,13 @@ JSTaggedValue JSStableArray::Reverse(JSThread *thread, JSHandle<JSObject> thisOb
|
|||||||
} else if (upperExists) {
|
} else if (upperExists) {
|
||||||
array->Set(thread, lower, upperValueHandle.GetTaggedValue());
|
array->Set(thread, lower, upperValueHandle.GetTaggedValue());
|
||||||
JSTaggedValue::SetProperty(thread, thisObjVal, lowerP, upperValueHandle, true);
|
JSTaggedValue::SetProperty(thread, thisObjVal, lowerP, upperValueHandle, true);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
JSTaggedValue::DeletePropertyOrThrow(thread, thisObjVal, upperP);
|
JSTaggedValue::DeletePropertyOrThrow(thread, thisObjVal, upperP);
|
||||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
} else if (lowerExists) {
|
} else if (lowerExists) {
|
||||||
array->Set(thread, upper, lowerValueHandle.GetTaggedValue());
|
array->Set(thread, upper, lowerValueHandle.GetTaggedValue());
|
||||||
JSTaggedValue::SetProperty(thread, thisObjVal, upperP, lowerValueHandle, true);
|
JSTaggedValue::SetProperty(thread, thisObjVal, upperP, lowerValueHandle, true);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
JSTaggedValue::DeletePropertyOrThrow(thread, thisObjVal, lowerP);
|
JSTaggedValue::DeletePropertyOrThrow(thread, thisObjVal, lowerP);
|
||||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
}
|
}
|
||||||
|
@ -387,6 +387,7 @@ JSTaggedValue JSTaggedValue::OrdinaryToPrimitive(JSThread *thread, const JSHandl
|
|||||||
keyString = globalConst->GetHandledValueOfString();
|
keyString = globalConst->GetHandledValueOfString();
|
||||||
}
|
}
|
||||||
JSHandle<JSTaggedValue> entryfunc = GetProperty(thread, tagged, keyString).GetValue();
|
JSHandle<JSTaggedValue> entryfunc = GetProperty(thread, tagged, keyString).GetValue();
|
||||||
|
RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, JSTaggedValue::Exception());
|
||||||
if (entryfunc->IsCallable()) {
|
if (entryfunc->IsCallable()) {
|
||||||
JSHandle<JSTaggedValue> undefined = globalConst->GetHandledUndefined();
|
JSHandle<JSTaggedValue> undefined = globalConst->GetHandledUndefined();
|
||||||
EcmaRuntimeCallInfo *info =
|
EcmaRuntimeCallInfo *info =
|
||||||
|
@ -120,6 +120,7 @@ bool JSTypedArray::HasProperty(JSThread *thread, const JSHandle<JSTaggedValue> &
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
JSTaggedValue parent = JSTaggedValue::GetPrototype(thread, JSHandle<JSTaggedValue>::Cast(typedarrayObj));
|
JSTaggedValue parent = JSTaggedValue::GetPrototype(thread, JSHandle<JSTaggedValue>::Cast(typedarrayObj));
|
||||||
|
RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
|
||||||
if (!parent.IsNull()) {
|
if (!parent.IsNull()) {
|
||||||
return JSTaggedValue::HasProperty(thread, JSHandle<JSTaggedValue>(thread, parent), key);
|
return JSTaggedValue::HasProperty(thread, JSHandle<JSTaggedValue>(thread, parent), key);
|
||||||
}
|
}
|
||||||
@ -293,6 +294,7 @@ JSHandle<TaggedArray> JSTypedArray::OwnPropertyKeys(JSThread *thread, const JSHa
|
|||||||
for (uint32_t k = 0; k < bufferKeysLen; k++) {
|
for (uint32_t k = 0; k < bufferKeysLen; k++) {
|
||||||
tKey.Update(JSTaggedValue(k));
|
tKey.Update(JSTaggedValue(k));
|
||||||
JSHandle<JSTaggedValue> sKey(JSTaggedValue::ToString(thread, tKey));
|
JSHandle<JSTaggedValue> sKey(JSTaggedValue::ToString(thread, tKey));
|
||||||
|
RETURN_HANDLE_IF_ABRUPT_COMPLETION(TaggedArray, thread);
|
||||||
nameList->Set(thread, copyLength, sKey.GetTaggedValue());
|
nameList->Set(thread, copyLength, sKey.GetTaggedValue());
|
||||||
copyLength++;
|
copyLength++;
|
||||||
}
|
}
|
||||||
|
@ -407,7 +407,7 @@ JSHandle<JSFunction> ClassHelper::DefineClassFromExtractor(JSThread *thread, con
|
|||||||
const GlobalEnvConstants *globalConst = thread->GlobalConstants();
|
const GlobalEnvConstants *globalConst = thread->GlobalConstants();
|
||||||
JSTaggedValue::DefinePropertyOrThrow(thread, JSHandle<JSTaggedValue>(prototype),
|
JSTaggedValue::DefinePropertyOrThrow(thread, JSHandle<JSTaggedValue>(prototype),
|
||||||
globalConst->GetHandledConstructorString(), ctorDesc);
|
globalConst->GetHandledConstructorString(), ctorDesc);
|
||||||
|
RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSFunction, thread);
|
||||||
constructor->SetHomeObject(thread, prototype);
|
constructor->SetHomeObject(thread, prototype);
|
||||||
constructor->SetProtoOrHClass(thread, prototype);
|
constructor->SetProtoOrHClass(thread, prototype);
|
||||||
|
|
||||||
@ -547,7 +547,7 @@ JSHandle<JSFunction> ClassHelper::DefineClassWithConstructorHClass(JSThread *thr
|
|||||||
const GlobalEnvConstants *globalConst = thread->GlobalConstants();
|
const GlobalEnvConstants *globalConst = thread->GlobalConstants();
|
||||||
JSTaggedValue::DefinePropertyOrThrow(thread, JSHandle<JSTaggedValue>(prototype),
|
JSTaggedValue::DefinePropertyOrThrow(thread, JSHandle<JSTaggedValue>(prototype),
|
||||||
globalConst->GetHandledConstructorString(), ctorDesc);
|
globalConst->GetHandledConstructorString(), ctorDesc);
|
||||||
|
RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSFunction, thread);
|
||||||
constructor->SetHomeObject(thread, prototype);
|
constructor->SetHomeObject(thread, prototype);
|
||||||
constructor->SetProtoOrHClass(thread, ihclass);
|
constructor->SetProtoOrHClass(thread, ihclass);
|
||||||
|
|
||||||
|
@ -1696,6 +1696,7 @@ JSHandle<JSIntlBoundFunction> ObjectFactory::NewJSIntlBoundFunction(MethodIndex
|
|||||||
JSHandle<JSTaggedValue> nameKey = globalConst->GetHandledNameString();
|
JSHandle<JSTaggedValue> nameKey = globalConst->GetHandledNameString();
|
||||||
PropertyDescriptor nameDesc(thread_, emptyString, false, false, true);
|
PropertyDescriptor nameDesc(thread_, emptyString, false, false, true);
|
||||||
JSTaggedValue::DefinePropertyOrThrow(thread_, JSHandle<JSTaggedValue>::Cast(function), nameKey, nameDesc);
|
JSTaggedValue::DefinePropertyOrThrow(thread_, JSHandle<JSTaggedValue>::Cast(function), nameKey, nameDesc);
|
||||||
|
RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSIntlBoundFunction, thread_);
|
||||||
return intlBoundFunc;
|
return intlBoundFunc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1716,6 +1717,7 @@ JSHandle<JSProxyRevocFunction> ObjectFactory::NewJSProxyRevocFunction(const JSHa
|
|||||||
JSHandle<JSTaggedValue> nameKey = globalConst->GetHandledNameString();
|
JSHandle<JSTaggedValue> nameKey = globalConst->GetHandledNameString();
|
||||||
PropertyDescriptor nameDesc(thread_, emptyString, false, false, true);
|
PropertyDescriptor nameDesc(thread_, emptyString, false, false, true);
|
||||||
JSTaggedValue::DefinePropertyOrThrow(thread_, JSHandle<JSTaggedValue>::Cast(function), nameKey, nameDesc);
|
JSTaggedValue::DefinePropertyOrThrow(thread_, JSHandle<JSTaggedValue>::Cast(function), nameKey, nameDesc);
|
||||||
|
RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSProxyRevocFunction, thread_);
|
||||||
return revocFunction;
|
return revocFunction;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1810,6 +1812,7 @@ JSHandle<JSPrimitiveRef> ObjectFactory::NewJSPrimitiveRef(const JSHandle<JSFunct
|
|||||||
uint32_t length = EcmaStringAccessor(object.GetTaggedValue()).GetLength();
|
uint32_t length = EcmaStringAccessor(object.GetTaggedValue()).GetLength();
|
||||||
PropertyDescriptor desc(thread_, JSHandle<JSTaggedValue>(thread_, JSTaggedValue(length)), false, false, false);
|
PropertyDescriptor desc(thread_, JSHandle<JSTaggedValue>(thread_, JSTaggedValue(length)), false, false, false);
|
||||||
JSTaggedValue::DefinePropertyOrThrow(thread_, JSHandle<JSTaggedValue>(obj), lengthStr, desc);
|
JSTaggedValue::DefinePropertyOrThrow(thread_, JSHandle<JSTaggedValue>(obj), lengthStr, desc);
|
||||||
|
RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSPrimitiveRef, thread_);
|
||||||
}
|
}
|
||||||
|
|
||||||
return obj;
|
return obj;
|
||||||
|
@ -259,6 +259,7 @@ void ObjectOperator::GlobalLookupProperty()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
JSTaggedValue proto = JSTaggedValue::GetPrototype(thread_, holder_);
|
JSTaggedValue proto = JSTaggedValue::GetPrototype(thread_, holder_);
|
||||||
|
RETURN_IF_ABRUPT_COMPLETION(thread_);
|
||||||
if (!proto.IsHeapObject()) {
|
if (!proto.IsHeapObject()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -280,6 +281,7 @@ void ObjectOperator::LookupProperty()
|
|||||||
}
|
}
|
||||||
|
|
||||||
JSTaggedValue proto = JSTaggedValue::GetPrototype(thread_, holder_);
|
JSTaggedValue proto = JSTaggedValue::GetPrototype(thread_, holder_);
|
||||||
|
RETURN_IF_ABRUPT_COMPLETION(thread_);
|
||||||
if (!proto.IsHeapObject()) {
|
if (!proto.IsHeapObject()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -105,6 +105,7 @@ void PGOProfiler::ProfileDefineClass(JSThread *thread, JSTaggedType func, int32_
|
|||||||
auto currentType = PGOSampleType::CreateClassType(ctorMethodId);
|
auto currentType = PGOSampleType::CreateClassType(ctorMethodId);
|
||||||
|
|
||||||
auto superFuncValue = JSTaggedValue::GetPrototype(thread, ctorValue);
|
auto superFuncValue = JSTaggedValue::GetPrototype(thread, ctorValue);
|
||||||
|
RETURN_IF_ABRUPT_COMPLETION(thread);
|
||||||
PGOSampleType superType = PGOSampleType::CreateClassType(0);
|
PGOSampleType superType = PGOSampleType::CreateClassType(0);
|
||||||
if (superFuncValue.IsJSFunction()) {
|
if (superFuncValue.IsJSFunction()) {
|
||||||
auto superFuncFunction = JSFunction::Cast(superFuncValue);
|
auto superFuncFunction = JSFunction::Cast(superFuncValue);
|
||||||
|
@ -236,6 +236,7 @@ JSTaggedValue RuntimeStubs::RuntimeSuperCallSpread(JSThread *thread, const JSHan
|
|||||||
const JSHandle<JSTaggedValue> &array)
|
const JSHandle<JSTaggedValue> &array)
|
||||||
{
|
{
|
||||||
JSHandle<JSTaggedValue> superFunc(thread, JSTaggedValue::GetPrototype(thread, func));
|
JSHandle<JSTaggedValue> superFunc(thread, JSTaggedValue::GetPrototype(thread, func));
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
ASSERT(superFunc->IsJSFunction());
|
ASSERT(superFunc->IsJSFunction());
|
||||||
|
|
||||||
JSHandle<TaggedArray> argv(thread, RuntimeGetCallSpreadArgs(thread, array));
|
JSHandle<TaggedArray> argv(thread, RuntimeGetCallSpreadArgs(thread, array));
|
||||||
@ -275,6 +276,7 @@ JSTaggedValue RuntimeStubs::RuntimeNewObjApply(JSThread *thread, const JSHandle<
|
|||||||
JSHandle<TaggedArray> argsArray = factory->NewTaggedArray(length);
|
JSHandle<TaggedArray> argsArray = factory->NewTaggedArray(length);
|
||||||
for (uint32_t i = 0; i < length; ++i) {
|
for (uint32_t i = 0; i < length; ++i) {
|
||||||
auto prop = JSTaggedValue::GetProperty(thread, array, i).GetValue();
|
auto prop = JSTaggedValue::GetProperty(thread, array, i).GetValue();
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
argsArray->Set(thread, i, prop);
|
argsArray->Set(thread, i, prop);
|
||||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
}
|
}
|
||||||
@ -383,6 +385,7 @@ JSTaggedValue RuntimeStubs::RuntimeCopyDataProperties(JSThread *thread, const JS
|
|||||||
if (!src->IsNull() && !src->IsUndefined()) {
|
if (!src->IsNull() && !src->IsUndefined()) {
|
||||||
// 2. Let from be ! ToObject(source).
|
// 2. Let from be ! ToObject(source).
|
||||||
JSHandle<JSTaggedValue> from(JSTaggedValue::ToObject(thread, src));
|
JSHandle<JSTaggedValue> from(JSTaggedValue::ToObject(thread, src));
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
JSHandle<TaggedArray> keys = JSTaggedValue::GetOwnPropertyKeys(thread, from);
|
JSHandle<TaggedArray> keys = JSTaggedValue::GetOwnPropertyKeys(thread, from);
|
||||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
|
|
||||||
@ -452,6 +455,7 @@ JSTaggedValue RuntimeStubs::RuntimeStArraySpread(JSThread *thread, const JSHandl
|
|||||||
bool success = JSTaggedValue::GetOwnProperty(thread, iterResult, valueStr, desc);
|
bool success = JSTaggedValue::GetOwnProperty(thread, iterResult, valueStr, desc);
|
||||||
if (success && desc.IsEnumerable()) {
|
if (success && desc.IsEnumerable()) {
|
||||||
JSTaggedValue::DefineOwnProperty(thread, dst, indexHandle, desc);
|
JSTaggedValue::DefineOwnProperty(thread, dst, indexHandle, desc);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
int tmp = indexHandle->GetInt();
|
int tmp = indexHandle->GetInt();
|
||||||
indexHandle.Update(JSTaggedValue(tmp + 1));
|
indexHandle.Update(JSTaggedValue(tmp + 1));
|
||||||
}
|
}
|
||||||
@ -546,6 +550,7 @@ JSTaggedValue RuntimeStubs::RuntimeStOwnByValue(JSThread *thread, const JSHandle
|
|||||||
JSHandle<JSTaggedValue> propKey = JSTaggedValue::ToPropertyKey(thread, key);
|
JSHandle<JSTaggedValue> propKey = JSTaggedValue::ToPropertyKey(thread, key);
|
||||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
bool ret = JSTaggedValue::DefineOwnProperty(thread, obj, propKey, desc);
|
bool ret = JSTaggedValue::DefineOwnProperty(thread, obj, propKey, desc);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
return RuntimeThrowTypeError(thread, "StOwnByValue failed");
|
return RuntimeThrowTypeError(thread, "StOwnByValue failed");
|
||||||
}
|
}
|
||||||
@ -652,6 +657,7 @@ JSTaggedValue RuntimeStubs::RuntimeStOwnByIndex(JSThread *thread, const JSHandle
|
|||||||
|
|
||||||
PropertyDescriptor desc(thread, value, true, enumerable, true);
|
PropertyDescriptor desc(thread, value, true, enumerable, true);
|
||||||
bool ret = JSTaggedValue::DefineOwnProperty(thread, obj, idx, desc);
|
bool ret = JSTaggedValue::DefineOwnProperty(thread, obj, idx, desc);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
return RuntimeThrowTypeError(thread, "SetOwnByIndex failed");
|
return RuntimeThrowTypeError(thread, "SetOwnByIndex failed");
|
||||||
}
|
}
|
||||||
@ -904,6 +910,7 @@ JSTaggedValue RuntimeStubs::RuntimeSetClassInheritanceRelationship(JSThread *thr
|
|||||||
method->SetFunctionKind(FunctionKind::DERIVED_CONSTRUCTOR);
|
method->SetFunctionKind(FunctionKind::DERIVED_CONSTRUCTOR);
|
||||||
parentPrototype = JSTaggedValue::GetProperty(thread, parent,
|
parentPrototype = JSTaggedValue::GetProperty(thread, parent,
|
||||||
globalConst->GetHandledPrototypeString()).GetValue();
|
globalConst->GetHandledPrototypeString()).GetValue();
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
if (!parentPrototype->IsECMAObject() && !parentPrototype->IsNull()) {
|
if (!parentPrototype->IsECMAObject() && !parentPrototype->IsNull()) {
|
||||||
return RuntimeThrowTypeError(thread, "parent class have no valid prototype");
|
return RuntimeThrowTypeError(thread, "parent class have no valid prototype");
|
||||||
}
|
}
|
||||||
@ -980,6 +987,7 @@ JSTaggedValue RuntimeStubs::RuntimeStOwnByValueWithNameSet(JSThread *thread, con
|
|||||||
JSHandle<JSTaggedValue> propKey = JSTaggedValue::ToPropertyKey(thread, key);
|
JSHandle<JSTaggedValue> propKey = JSTaggedValue::ToPropertyKey(thread, key);
|
||||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
bool ret = JSTaggedValue::DefineOwnProperty(thread, obj, propKey, desc);
|
bool ret = JSTaggedValue::DefineOwnProperty(thread, obj, propKey, desc);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
return RuntimeThrowTypeError(thread, "StOwnByValueWithNameSet failed");
|
return RuntimeThrowTypeError(thread, "StOwnByValueWithNameSet failed");
|
||||||
}
|
}
|
||||||
@ -1004,6 +1012,7 @@ JSTaggedValue RuntimeStubs::RuntimeStOwnByName(JSThread *thread, const JSHandle<
|
|||||||
|
|
||||||
PropertyDescriptor desc(thread, value, true, enumerable, true);
|
PropertyDescriptor desc(thread, value, true, enumerable, true);
|
||||||
bool ret = JSTaggedValue::DefineOwnProperty(thread, obj, prop, desc);
|
bool ret = JSTaggedValue::DefineOwnProperty(thread, obj, prop, desc);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
return RuntimeThrowTypeError(thread, "SetOwnByName failed");
|
return RuntimeThrowTypeError(thread, "SetOwnByName failed");
|
||||||
}
|
}
|
||||||
@ -1023,6 +1032,7 @@ JSTaggedValue RuntimeStubs::RuntimeStOwnByNameWithNameSet(JSThread *thread,
|
|||||||
|
|
||||||
PropertyDescriptor desc(thread, valueHandle, true, enumerable, true);
|
PropertyDescriptor desc(thread, valueHandle, true, enumerable, true);
|
||||||
bool ret = JSTaggedValue::DefineOwnProperty(thread, objHandle, propHandle, desc);
|
bool ret = JSTaggedValue::DefineOwnProperty(thread, objHandle, propHandle, desc);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
return RuntimeThrowTypeError(thread, "SetOwnByNameWithNameSet failed");
|
return RuntimeThrowTypeError(thread, "SetOwnByNameWithNameSet failed");
|
||||||
}
|
}
|
||||||
@ -1301,6 +1311,7 @@ JSTaggedValue RuntimeStubs::RuntimeTryLdGlobalByName(JSThread *thread, const JSH
|
|||||||
const JSHandle<JSTaggedValue> &prop)
|
const JSHandle<JSTaggedValue> &prop)
|
||||||
{
|
{
|
||||||
OperationResult res = JSTaggedValue::GetProperty(thread, obj, prop);
|
OperationResult res = JSTaggedValue::GetProperty(thread, obj, prop);
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
if (!res.GetPropertyMetaData().IsFound()) {
|
if (!res.GetPropertyMetaData().IsFound()) {
|
||||||
return RuntimeThrowReferenceError(thread, prop, " is not defined");
|
return RuntimeThrowReferenceError(thread, prop, " is not defined");
|
||||||
}
|
}
|
||||||
@ -1921,7 +1932,7 @@ JSTaggedValue RuntimeStubs::CommonCreateObjectWithExcludedKeys(JSThread *thread,
|
|||||||
return restObj.GetTaggedValue();
|
return restObj.GetTaggedValue();
|
||||||
}
|
}
|
||||||
JSHandle<JSObject> obj(JSTaggedValue::ToObject(thread, objVal));
|
JSHandle<JSObject> obj(JSTaggedValue::ToObject(thread, objVal));
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
JSHandle<TaggedArray> allKeys = JSObject::GetOwnPropertyKeys(thread, obj);
|
JSHandle<TaggedArray> allKeys = JSObject::GetOwnPropertyKeys(thread, obj);
|
||||||
uint32_t numAllKeys = allKeys->GetLength();
|
uint32_t numAllKeys = allKeys->GetLength();
|
||||||
JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined());
|
JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined());
|
||||||
@ -2074,6 +2085,7 @@ JSTaggedValue RuntimeStubs::RuntimeSuperCall(JSThread *thread, const JSHandle<JS
|
|||||||
uint16_t length)
|
uint16_t length)
|
||||||
{
|
{
|
||||||
JSHandle<JSTaggedValue> superFunc(thread, JSTaggedValue::GetPrototype(thread, func));
|
JSHandle<JSTaggedValue> superFunc(thread, JSTaggedValue::GetPrototype(thread, func));
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
ASSERT(superFunc->IsJSFunction());
|
ASSERT(superFunc->IsJSFunction());
|
||||||
|
|
||||||
ObjectFactory *factory = thread->GetEcmaVM()->GetFactory();
|
ObjectFactory *factory = thread->GetEcmaVM()->GetFactory();
|
||||||
@ -2099,6 +2111,7 @@ JSTaggedValue RuntimeStubs::RuntimeOptSuperCall(JSThread *thread, uintptr_t argv
|
|||||||
JSHandle<JSTaggedValue> func = GetHArg<JSTaggedValue>(argv, argc, 0);
|
JSHandle<JSTaggedValue> func = GetHArg<JSTaggedValue>(argv, argc, 0);
|
||||||
JSHandle<JSTaggedValue> newTarget = GetHArg<JSTaggedValue>(argv, argc, 1);
|
JSHandle<JSTaggedValue> newTarget = GetHArg<JSTaggedValue>(argv, argc, 1);
|
||||||
JSHandle<JSTaggedValue> superFunc(thread, JSTaggedValue::GetPrototype(thread, func));
|
JSHandle<JSTaggedValue> superFunc(thread, JSTaggedValue::GetPrototype(thread, func));
|
||||||
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||||
ASSERT(superFunc->IsJSFunction());
|
ASSERT(superFunc->IsJSFunction());
|
||||||
uint16_t length = argc - fixNums;
|
uint16_t length = argc - fixNums;
|
||||||
JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined();
|
JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined();
|
||||||
|
Loading…
Reference in New Issue
Block a user