diff --git a/ecmascript/compiler/stub_builder.cpp b/ecmascript/compiler/stub_builder.cpp index 2f3bdd3aef421150ce033ceff866ae275261a6fd..d2559c6c0eb5640c6d9d4fc8c6a53c091dcdbdfd 100644 --- a/ecmascript/compiler/stub_builder.cpp +++ b/ecmascript/compiler/stub_builder.cpp @@ -4998,8 +4998,8 @@ GateRef StubBuilder::SetPropertyByIndex(GateRef glue, GateRef receiver, GateRef Bind(&throwNotExtensible); { if (mayThrow) { - GateRef taggedId = Int32(GET_MESSAGE_STRING_ID(SetPropertyWhenNotExtensible)); - CallRuntime(glue, RTSTUB_ID(ThrowTypeError), {IntToTaggedInt(taggedId)}); + GateRef taggedId = Int32(GET_MESSAGE_STRING_ID(SetPropertyWhenNotExtensibleByIndex)); + CallRuntime(glue, RTSTUB_ID(ThrowTypeErrorWithParam), {IntToTaggedInt(taggedId), IntToTaggedInt(index)}); returnValue = Exception(); } else { returnValue = TaggedFalse(); @@ -5170,8 +5170,8 @@ GateRef StubBuilder::DefinePropertyByIndex(GateRef glue, GateRef receiver, GateR } Bind(&throwNotExtensible); { - GateRef taggedId = Int32(GET_MESSAGE_STRING_ID(SetPropertyWhenNotExtensible)); - CallRuntime(glue, RTSTUB_ID(ThrowTypeError), { IntToTaggedInt(taggedId) }); + GateRef taggedId = Int32(GET_MESSAGE_STRING_ID(SetPropertyWhenNotExtensibleByIndex)); + CallRuntime(glue, RTSTUB_ID(ThrowTypeErrorWithParam), {IntToTaggedInt(taggedId), IntToTaggedInt(index)}); returnValue = Exception(); Jump(&exit); } @@ -5181,6 +5181,33 @@ GateRef StubBuilder::DefinePropertyByIndex(GateRef glue, GateRef receiver, GateR return ret; } +GateRef StubBuilder::ThrowTypeErrorInextensiableAddProperty(GateRef glue, GateRef key) +{ + auto env = GetEnvironment(); + Label subEntry(env); + env->SubCfgEntry(&subEntry); + Label exit(env); + Label isString(env); + Label notString(env); + BRANCH(TaggedIsString(glue, key), &isString, ¬String); + Bind(&isString); + { + GateRef taggedId = Int32(GET_MESSAGE_STRING_ID(SetPropertyWhenNotExtensibleByName)); + CallRuntime(glue, RTSTUB_ID(ThrowTypeErrorWithParam), {IntToTaggedInt(taggedId), key}); + Jump(&exit); + } + Bind(¬String); + { + GateRef taggedId = Int32(GET_MESSAGE_STRING_ID(SetPropertyWhenNotExtensible)); + CallRuntime(glue, RTSTUB_ID(ThrowTypeError), {IntToTaggedInt(taggedId)}); + Jump(&exit); + } + Bind(&exit); + auto ret = Exception(); + env->SubCfgExit(); + return ret; +} + GateRef StubBuilder::SetPropertyByName(GateRef glue, GateRef receiver, GateRef key, @@ -5540,9 +5567,7 @@ GateRef StubBuilder::SetPropertyByName(GateRef glue, Bind(&inextensible); { if (mayThrow) { - GateRef taggedId = Int32(GET_MESSAGE_STRING_ID(SetPropertyWhenNotExtensible)); - CallRuntime(glue, RTSTUB_ID(ThrowTypeError), {IntToTaggedInt(taggedId)}); - result = Exception(); + result = ThrowTypeErrorInextensiableAddProperty(glue, key); } else { result = TaggedFalse(); } @@ -5837,9 +5862,7 @@ GateRef StubBuilder::DefinePropertyByName(GateRef glue, GateRef receiver, GateRe BRANCH(IsExtensible(glue, receiver), &extensible, &inextensible); Bind(&inextensible); { - GateRef taggedId = Int32(GET_MESSAGE_STRING_ID(SetPropertyWhenNotExtensible)); - CallRuntime(glue, RTSTUB_ID(ThrowTypeError), { IntToTaggedInt(taggedId) }); - result = Exception(); + result = ThrowTypeErrorInextensiableAddProperty(glue, key); Jump(&exit); } Bind(&extensible); diff --git a/ecmascript/compiler/stub_builder.h b/ecmascript/compiler/stub_builder.h index e8c38aa53c45697f326ced237b12a16a7739f065..859a205a52c59609b9c39e5118afb315bc2522e7 100644 --- a/ecmascript/compiler/stub_builder.h +++ b/ecmascript/compiler/stub_builder.h @@ -882,6 +882,7 @@ public: bool canUseIsInternal = false, bool defineSemantics = false, bool mayThrow = true); // Crawl prototype chain + GateRef ThrowTypeErrorInextensiableAddProperty(GateRef glue, GateRef key); GateRef DefinePropertyByName(GateRef glue, GateRef receiver, GateRef key, GateRef value, GateRef isInternal, GateRef SCheckModelIsCHECK, ProfileOperation callback = ProfileOperation()); diff --git a/ecmascript/js_object.cpp b/ecmascript/js_object.cpp index bc0f2ac9ca1257ebce91c29b0af93cfda3fdc9ad..2df5b227c3965e8759a0a4ad24ca8136e06b3956 100644 --- a/ecmascript/js_object.cpp +++ b/ecmascript/js_object.cpp @@ -1032,6 +1032,29 @@ bool JSObject::SetPropertyForDataDescriptorProxy(JSThread *thread, ObjectOperato return CreateDataProperty(thread, JSHandle(receiver), key, value); } +bool JSObject::ThrowTypeErrorInextensiableAddProperty(ObjectOperator *op) +{ + JSThread *thread = op->GetThread(); + if (!op->IsElement()) { + JSHandle keyHandle = op->GetKey(); + if (keyHandle->IsString()) { + CString keyStr = ConvertToString(thread, EcmaString::Cast(keyHandle.GetTaggedValue())); + THROW_TYPE_ERROR_AND_RETURN( + thread, + GET_MESSAGE_STRING_WITH_PARAM(SetPropertyWhenNotExtensibleByName, keyStr.c_str()), + false); + } else { + THROW_TYPE_ERROR_AND_RETURN(thread, GET_MESSAGE_STRING(SetPropertyWhenNotExtensible), false); + } + } else { + uint32_t index = op->GetIndex(); + THROW_TYPE_ERROR_AND_RETURN( + thread, + GET_MESSAGE_STRING_WITH_PARAM(SetPropertyWhenNotExtensibleByIndex, index), + false); + } +} + bool JSObject::SetPropertyForDataDescriptor(ObjectOperator *op, JSHandle value, JSHandle &receiver, bool mayThrow, bool isInternalAccessor) { @@ -1106,7 +1129,7 @@ bool JSObject::SetPropertyForDataDescriptor(ObjectOperator *op, JSHandleIsExtensible(thread) && !(receiver->IsJSSharedArray() && op->IsElement())) { if (mayThrow) { - THROW_TYPE_ERROR_AND_RETURN(thread, GET_MESSAGE_STRING(SetPropertyWhenNotExtensible), false); + return ThrowTypeErrorInextensiableAddProperty(op); } return false; } diff --git a/ecmascript/js_object.h b/ecmascript/js_object.h index d05d1c99066f6d152f6feb941f0e64ad2467ac6a..78e52ef616427f59e076cf6d7cec09d56cf6ba4e 100644 --- a/ecmascript/js_object.h +++ b/ecmascript/js_object.h @@ -862,6 +862,7 @@ private: static bool SetPropertyForDataDescriptorProxy(JSThread *thread, ObjectOperator *op, const JSHandle &value, JSHandle &receiver); + static bool ThrowTypeErrorInextensiableAddProperty(ObjectOperator *op); }; } // namespace ecmascript } // namespace panda diff --git a/ecmascript/message_string.h b/ecmascript/message_string.h index f8820ab3e784dff4ddb4c1f6dd912db918688dee..cd7bf4bd33c1f7928a4d4c4c6ddee7003330aacd 100644 --- a/ecmascript/message_string.h +++ b/ecmascript/message_string.h @@ -17,7 +17,7 @@ #define ECMASCRIPT_MESSAGE_STRING_H #include - +#include "common_components/base/c_string.h" #include "ecmascript/compiler/common_stub_csigns.h" #include "ecmascript/compiler/interpreter_stub.h" @@ -33,6 +33,8 @@ namespace panda::ecmascript { V(NotSendableSubClass, "The subclass of sendable class must be a sendable class") \ V(FunctionCallNotConstructor, "class constructor cannot call") \ V(SetPropertyWhenNotExtensible, "Cannot add property in prevent extensions") \ + V(SetPropertyWhenNotExtensibleByIndex, "Cannot add property \"%d\" in prevent extensions") \ + V(SetPropertyWhenNotExtensibleByName, "Cannot add property \"%s\" in prevent extensions") \ V(GetPropertyOutOfBounds, "Get Property index out-of-bounds") \ V(CanNotSetPropertyOnContainer, "Cannot set property on Container") \ V(NonCallable, "CallObj is NonCallable") \ @@ -147,5 +149,10 @@ public: // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) #define GET_MESSAGE_STRING_ID(name) static_cast((MessageString::MessageId::Message_##name)) #define GET_MESSAGE_STRING(name) MessageString::GetMessageString(GET_MESSAGE_STRING_ID(name)).c_str() +#define GET_MESSAGE_STRING_WITH_PARAM(name, ...) \ + common::CString::FormatString( \ + MessageString::GetMessageString(GET_MESSAGE_STRING_ID(name)).c_str(), \ + __VA_ARGS__ \ + ).Str() } // namespace panda::ecmascript #endif // ECMASCRIPT_MESSAGE_STRING_H diff --git a/ecmascript/object_fast_operator-inl.h b/ecmascript/object_fast_operator-inl.h index f5d103dba5c8500880127444f1c000bcfd342780..9ca4faf4a8a78e32d264a6b0986ab158de1bfaf8 100644 --- a/ecmascript/object_fast_operator-inl.h +++ b/ecmascript/object_fast_operator-inl.h @@ -624,8 +624,17 @@ JSTaggedValue ObjectFastOperator::SetPropertyByName(JSThread *thread, JSTaggedVa JSHandle valueHandle(thread, value); if (UNLIKELY(!JSObject::Cast(receiver)->IsExtensible())) { - THROW_TYPE_ERROR_AND_RETURN(thread, GET_MESSAGE_STRING(SetPropertyWhenNotExtensible), - JSTaggedValue::Exception()); + if (keyHandle->IsString()) { + CString keyStr = ConvertToString(thread, EcmaString::Cast(key)); + THROW_TYPE_ERROR_AND_RETURN( + thread, + GET_MESSAGE_STRING_WITH_PARAM(SetPropertyWhenNotExtensibleByName, keyStr.c_str()), + JSTaggedValue::Exception() + ); + } else { + THROW_TYPE_ERROR_AND_RETURN(thread, GET_MESSAGE_STRING(SetPropertyWhenNotExtensible), + JSTaggedValue::Exception()); + } } ASSERT(!receiver.IsJSShared()); PropertyAttributes attr = PropertyAttributes::Default(); @@ -1300,7 +1309,7 @@ JSTaggedValue ObjectFastOperator::AddPropertyByIndex(JSThread *thread, JSTaggedV [[maybe_unused]] EcmaHandleScope handleScope(thread); // fixme(hzzhouzebin) this makes SharedArray's frozen no sense. if (UNLIKELY(!JSObject::Cast(receiver)->IsExtensible()) && !receiver.IsJSSharedArray()) { - THROW_TYPE_ERROR_AND_RETURN(thread, GET_MESSAGE_STRING(SetPropertyWhenNotExtensible), + THROW_TYPE_ERROR_AND_RETURN(thread, GET_MESSAGE_STRING_WITH_PARAM(SetPropertyWhenNotExtensibleByIndex, index), JSTaggedValue::Exception()); } diff --git a/ecmascript/stubs/runtime_stub_list.h b/ecmascript/stubs/runtime_stub_list.h index b51b764fdd372bf6d2ed3e6e8c377eaeffdff35a..f9dcd9c4f06b3c5bc5c9b67061685cdd4bbf862a 100644 --- a/ecmascript/stubs/runtime_stub_list.h +++ b/ecmascript/stubs/runtime_stub_list.h @@ -243,6 +243,7 @@ namespace panda::ecmascript { V(CallJSObjDeletePrototype) \ V(ToPropertyKey) \ V(ThrowTypeError) \ + V(ThrowTypeErrorWithParam) \ V(MismatchError) \ V(NotifyArrayPrototypeChanged) \ V(NumberToString) \ diff --git a/ecmascript/stubs/runtime_stubs.cpp b/ecmascript/stubs/runtime_stubs.cpp index 9b13b9f3dff2c48edb7dee60b2b3b50719dd1ae0..3f29022164446c815bb650c7a3b7d477067daabb 100644 --- a/ecmascript/stubs/runtime_stubs.cpp +++ b/ecmascript/stubs/runtime_stubs.cpp @@ -2197,6 +2197,30 @@ DEF_RUNTIME_STUBS(ThrowTypeError) THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error.GetTaggedValue(), JSTaggedValue::Hole().GetRawData()); } +DEF_RUNTIME_STUBS(ThrowTypeErrorWithParam) +{ + RUNTIME_STUBS_HEADER(ThrowTypeError); + JSTaggedValue argMessageStringId = GetArg(argv, argc, 0); // 0: means the zeroth parameter + JSTaggedValue argParam = GetArg(argv, argc, 1); // 1: means the first parameter + std::string message = ""; + if (argParam.IsInt()) { // number + message = common::CString::FormatString( + MessageString::GetMessageString(argMessageStringId.GetInt()).c_str(), + argParam.GetInt() + ).Str(); + } else { // string + ASSERT(argParam.IsString()); + CString keyStr = ConvertToString(thread, EcmaString::Cast(argParam)); + message = common::CString::FormatString( + MessageString::GetMessageString(argMessageStringId.GetInt()).c_str(), + keyStr.c_str() + ).Str(); + } + ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); + JSHandle error = factory->GetJSError(ErrorType::TYPE_ERROR, message.c_str(), StackCheck::NO); + THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error.GetTaggedValue(), JSTaggedValue::Hole().GetRawData()); +} + DEF_RUNTIME_STUBS(MismatchError) { RUNTIME_STUBS_HEADER(MismatchError); diff --git a/test/sharedtest/check/expect_output.txt b/test/sharedtest/check/expect_output.txt index e416357d858b229e54a9aade8454794bf6f115bc..3c396db90a9281fe59526ca1d77c5ed52878df13 100644 --- a/test/sharedtest/check/expect_output.txt +++ b/test/sharedtest/check/expect_output.txt @@ -50,8 +50,8 @@ Fail to set prop through accessor with mismatched type. err: TypeError: Cannot s Start testUpdateInstanceFunction Fail to replace instance's func. err: TypeError: Cannot assign to read only property Start testUpdatePrototype -Fail to update prototype. err: TypeError: Cannot add property in prevent extensions -Fail to extend prop to constructor's prototype. err: TypeError: Cannot add property in prevent extensions +Fail to update prototype. err: TypeError: Cannot add property "staticSubClassPropString" in prevent extensions +Fail to extend prop to constructor's prototype. err: TypeError: Cannot add property "tmpProp" in prevent extensions I'm propString Fail to change constructor of instance's prototype. err: TypeError: Cannot assign to read only property Fail to replace instance's prototype. err: TypeError: Cannot set proto with sendable object @@ -65,10 +65,10 @@ Start testExtend Fail to extend prop with defineProperty. err: TypeError: Cannot define property Fail to extend prop1 with defineProperty. err: TypeError: Cannot define property Fail to extend prop2 with defineProperties. err: TypeError: Cannot define property -Fail to extend prop3 with stobjbyname. err: TypeError: Cannot add property in prevent extensions +Fail to extend prop3 with stobjbyname. err: TypeError: Cannot add property "prop3" in prevent extensions Start testObjectProtoFunc Start testObjectAssign -Fail to call Object.assign to extend target. err: TypeError: Cannot add property in prevent extensions +Fail to call Object.assign to extend target. err: TypeError: Cannot add property "a" in prevent extensions Fail to call Object.assign to update propString with mismatched type. err: TypeError: Cannot set sendable property with mismatched type Success to call Object.assign to update propString Start testObjectCreate diff --git a/test/sharedtest/sendable/expect_output.txt b/test/sharedtest/sendable/expect_output.txt index 810a721bf71da9c5fe5ad631832ff72bf4ed97ce..c5dbb5151bc45dadc3d76a5397aae7c521397c29 100644 --- a/test/sharedtest/sendable/expect_output.txt +++ b/test/sharedtest/sendable/expect_output.txt @@ -22,7 +22,19 @@ sendable contain static non-sendable failed. err: TypeError: Cannot set sendable sendable contain undefined succeed. sendable contain lexenv succeed. sendable with concurrent decorator succeed. -sendable add property failed. err: TypeError: Cannot add property in prevent extensions, code: undefined +sendable add property failed. err: TypeError: Cannot add property "age" in prevent extensions, code: undefined sendable change property failed. err: TypeError: Cannot set sendable property with mismatched type, code: undefined sendable delete property failed. err: TypeError: Cannot delete property, code: undefined sendable can not change attr. err: TypeError: shared obj does not support changing or deleting attributes +TypeError: Cannot add property in prevent extensions +TypeError: Cannot add property "1" in prevent extensions +TypeError: Cannot add property "1" in prevent extensions +TypeError: Cannot add property "undefined" in prevent extensions +TypeError: Cannot add property "null" in prevent extensions +TypeError: Cannot add property "address" in prevent extensions +TypeError: Cannot add property in prevent extensions +TypeError: Cannot add property "address" in prevent extensions +TypeError: Cannot add property "1" in prevent extensions +TypeError: Cannot add property "1" in prevent extensions +TypeError: Cannot add property in prevent extensions +TypeError: Cannot add property "address" in prevent extensions diff --git a/test/sharedtest/sendable/sendable.ts b/test/sharedtest/sendable/sendable.ts index 1e484991667d3d4b337c40125ddde5874d667ed0..9d415049f72c1334097917ef7defbec3abb8e445 100644 --- a/test/sharedtest/sendable/sendable.ts +++ b/test/sharedtest/sendable/sendable.ts @@ -269,3 +269,86 @@ try { } catch (e) { print("sendable can not change attr. err: " + e); } + +const idSymbol = Symbol('id'); +let userString = '{"name":"lifei", "age":20, "1":"huawei"}' +class User { + constructor() { + "use sendable"; + } + name: string = ''; + age: number = 0; +} +let user = new User(); +let array = new SendableArray('ARK'); +try { + user[idSymbol] = ""; +} catch (err) { + print(err); // TypeError: Cannot add property in prevent extensions +} + +try { + user[1] = ""; +} catch (err) { + print(err); // TypeError: Cannot add property "1" in prevent extensions +} + +try { + user["1"] = ""; +} catch (err) { + print(err); // TypeError: Cannot add property "1" in prevent extensions +} + +try { + user[undefined] = ""; +} catch (err) { + print(err); // TypeError: Cannot add property "undefined" in prevent extensions +} + +try { + user[null] = ""; +} catch (err) { + print(err); // TypeError: Cannot add property "null" in prevent extensions +} + +try { + user["address"] = ""; +} catch (err) { + print(err); // TypeError: Cannot add property "address" in prevent extensions +} + +try { + Object.assign(user, {[idSymbol]: ""}); +} catch (err) { + print(err); // TypeError: Cannot add property in prevent extensions +} + +try { + Object.assign(user, {"address": ""}); +} catch (err) { + print(err); // TypeError: Cannot add property "address" in prevent extensions +} + +try { + Object.assign(user, {1: ""}); +} catch (err) { + print(err); // TypeError: Cannot add property "1" in prevent extensions +} + +try { + Object.assign(user, {"1": ""}); +} catch (err) { + print(err); // TypeError: Cannot add property "1" in prevent extensions +} + +try { + array[idSymbol] = ""; +} catch (err) { + print(err); // TypeError: Cannot add property in prevent extensions +} + +try { + array["address"] = ""; +} catch (err) { + print(err); // TypeError: Cannot add property "address" in prevent extensions +} \ No newline at end of file diff --git a/test/sharedtest/sharedarray/expect_output.txt b/test/sharedtest/sharedarray/expect_output.txt index 817aa63b8919b8c30349335ffb208ffa0b56c134..76706cd71f21aabd12f490d6d5d3769daf832ce8 100644 --- a/test/sharedtest/sharedarray/expect_output.txt +++ b/test/sharedtest/sharedarray/expect_output.txt @@ -71,8 +71,8 @@ Start Test pop 60 Start Test randomUpdate 30 -add element by index access failed. err: TypeError: Cannot add property in prevent extensions, code: undefined -add element by index access failed. err: TypeError: Cannot add property in prevent extensions, code: undefined +add element by index access failed. err: TypeError: Cannot add property "null" in prevent extensions, code: undefined +add element by index access failed. err: TypeError: Cannot add property "undefined" in prevent extensions, code: undefined add element by index access failed. err: BusinessError: The value of index is out of range., code: 10200001 Start Test randomGet 5,12,8,130,44 @@ -253,28 +253,28 @@ Start Test testStringForIC [IC] String Index access write out of range failed. err: BusinessError: The value of index is out of range., code: 10200001 Start Test arrayFrozenTest arrayFrozenTest [new] single string. arr: ARK -Add prop to array failed. err: TypeError: Cannot add property in prevent extensions +Add prop to array failed. err: TypeError: Cannot add property "notExistProp" in prevent extensions defineNotExistProp to array failed. err: TypeError: Cannot define property Update function [at] failed. err: TypeError: Cannot assign to read only property Update function [at] by defineProperty failed. err: TypeError: Cannot define property arrayFrozenTest [new]. arr: A,R,K -Add prop to array failed. err: TypeError: Cannot add property in prevent extensions +Add prop to array failed. err: TypeError: Cannot add property "notExistProp" in prevent extensions defineNotExistProp to array failed. err: TypeError: Cannot define property Update function [at] failed. err: TypeError: Cannot assign to read only property Update function [at] by defineProperty failed. err: TypeError: Cannot define property arrayFrozenTest static [from]. arr: A,R,K -Add prop to array failed. err: TypeError: Cannot add property in prevent extensions +Add prop to array failed. err: TypeError: Cannot add property "notExistProp" in prevent extensions defineNotExistProp to array failed. err: TypeError: Cannot define property Update function [at] failed. err: TypeError: Cannot assign to read only property Update function [at] by defineProperty failed. err: TypeError: Cannot define property arrayFrozenTest static [create]. arr: A,A,A -Add prop to array failed. err: TypeError: Cannot add property in prevent extensions +Add prop to array failed. err: TypeError: Cannot add property "notExistProp" in prevent extensions defineNotExistProp to array failed. err: TypeError: Cannot define property Update function [at] failed. err: TypeError: Cannot assign to read only property Update function [at] by defineProperty failed. err: TypeError: Cannot define property Start Test sharedArrayFrozenTest sharedArrayFrozenTest [new]. arr: A,R,K -Add prop to array failed. err: TypeError: Cannot add property in prevent extensions +Add prop to array failed. err: TypeError: Cannot add property "notExistProp" in prevent extensions defineNotExistProp to array failed. err: TypeError: Cannot define property Update function [at] failed. err: TypeError: Cannot assign to read only property Update function [at] by defineProperty failed. err: TypeError: Cannot define property diff --git a/test/sharedtest/sharedmap/expect_output.txt b/test/sharedtest/sharedmap/expect_output.txt index 2b8b5b2bfb56f39d0820b5de577767326ecdd7b4..1e590ba6ed42431e820cf1a363728296fe97d0ec 100755 --- a/test/sharedtest/sharedmap/expect_output.txt +++ b/test/sharedtest/sharedmap/expect_output.txt @@ -91,8 +91,8 @@ sharedMap set[unshared]: BusinessError: Parameter error. Only accept sendable va ===Class inheritance test begin === true 1 -add extension(.): TypeError: Cannot add property in prevent extensions -add extension([]): TypeError: Cannot add property in prevent extensions +add extension(.): TypeError: Cannot add property "extension" in prevent extensions +add extension([]): TypeError: Cannot add property "extension" in prevent extensions SubSendableMap set[unshared]: BusinessError: Parameter error. Only accept sendable value., errCode: 401 3 SubSendableMap [key, value][for-of]: [1, one] diff --git a/test/sharedtest/sharedset/expect_output.txt b/test/sharedtest/sharedset/expect_output.txt index 84bd2127aa8eca391c3a647225ce3e3c10d5222b..3887cf2b039290fbea40b8d3a44a2f7755740de0 100755 --- a/test/sharedtest/sharedset/expect_output.txt +++ b/test/sharedtest/sharedset/expect_output.txt @@ -49,8 +49,8 @@ true false true true -add extension(.): TypeError: Cannot add property in prevent extensions -add extension([]): TypeError: Cannot add property in prevent extensions +add extension(.): TypeError: Cannot add property "extension" in prevent extensions +add extension([]): TypeError: Cannot add property "extension" in prevent extensions ===Basic test end=== ===Concurrent modification during iteration Test(iterator) begin=== set size is 5 diff --git a/test/sharedtest/sharedset_extern/expect_output.txt b/test/sharedtest/sharedset_extern/expect_output.txt index 7dab9c486424ba77a3327d618cbf26d187cf0326..a77e353c476fd6469640b08dfa13f131159a2c19 100755 --- a/test/sharedtest/sharedset_extern/expect_output.txt +++ b/test/sharedtest/sharedset_extern/expect_output.txt @@ -28,8 +28,8 @@ true true true 3 -add extension(.): TypeError: Cannot add property in prevent extensions -add extension([]): TypeError: Cannot add property in prevent extensions +add extension(.): TypeError: Cannot add property "extension" in prevent extensions +add extension([]): TypeError: Cannot add property "extension" in prevent extensions SubSubSendableSet add[unshared]: BusinessError: Parameter error. Only accept sendable value., errCode: 401 SubSubSendableSet Delete Scenario[forEach]: BusinessError: Concurrent modification exception, errCode: 10200201 ===Class inheritance test end === diff --git a/test/sharedtest/sharedtypedarray/expect_output.txt b/test/sharedtest/sharedtypedarray/expect_output.txt index bf9c4ad73bc487a51a0a38fd34fcb364600a6c16..76f70bbdecea536f6d5475afb2d8976e8b865acc 100755 --- a/test/sharedtest/sharedtypedarray/expect_output.txt +++ b/test/sharedtest/sharedtypedarray/expect_output.txt @@ -659,8 +659,8 @@ true, array: [1,2,3] Object.freeze error: TypeError: Cannot define property Object.freeze freeze empty array success Object.defineProperty error: TypeError: Cannot define property -Add nonExistProp error: TypeError: Cannot add property in prevent extensions -Add nonExistProp error: TypeError: Cannot add property in prevent extensions +Add nonExistProp error: TypeError: Cannot add property "nonExistProp" in prevent extensions +Add nonExistProp error: TypeError: Cannot add property "nonExistProp" in prevent extensions ================Test Inheritance================ array: [1,4,3,2,5], sorted: [1,2,3,4,5] length: 5, byteLength: 20