diff --git a/ecmascript/napi/include/jsnapi_expo.h b/ecmascript/napi/include/jsnapi_expo.h index 7288689a092f9ff9cf7710d622e9bd5590c71016..e899866f31f77c3f18607a0d0970791622d9a916 100644 --- a/ecmascript/napi/include/jsnapi_expo.h +++ b/ecmascript/napi/include/jsnapi_expo.h @@ -608,9 +608,6 @@ public: bool IsJSSharedInt32Array(const EcmaVM *vm); bool IsJSSharedUint32Array(const EcmaVM *vm); bool IsJSSharedFloat32Array(const EcmaVM *vm); - bool IsJSSharedFloat64Array(const EcmaVM *vm); - bool IsJSSharedBigInt64Array(const EcmaVM *vm); - bool IsJSSharedBigUint64Array(const EcmaVM *vm); bool IsGeneratorObject(const EcmaVM *vm); bool IsJSPrimitiveSymbol(const EcmaVM *vm); @@ -976,7 +973,7 @@ public: Local *keys = nullptr, PropertyAttribute *attrs = nullptr, size_t nativeBindingsize = 0); - + static Local NewClassFunction(EcmaVM *vm, InternalFunctionCallback nativeFunc, NativePointerCallback deleter, @@ -1335,36 +1332,18 @@ public: int32_t length); }; -class PUBLIC_API SharedFloat64ArrayRef : public SendableTypedArrayRef { -public: - static Local New(const EcmaVM *vm, Local buffer, - int32_t byteOffset, int32_t length); -}; - class PUBLIC_API BigInt64ArrayRef : public TypedArrayRef { public: static Local New(const EcmaVM *vm, Local buffer, int32_t byteOffset, int32_t length); }; -class PUBLIC_API SharedBigInt64ArrayRef : public SendableTypedArrayRef { -public: - static Local New(const EcmaVM *vm, Local buffer, - int32_t byteOffset, int32_t length); -}; - class PUBLIC_API BigUint64ArrayRef : public TypedArrayRef { public: static Local New(const EcmaVM *vm, Local buffer, int32_t byteOffset, int32_t length); }; -class PUBLIC_API SharedBigUint64ArrayRef : public SendableTypedArrayRef { -public: - static Local New(const EcmaVM *vm, Local buffer, - int32_t byteOffset, int32_t length); -}; - class PUBLIC_API Exception { public: static Local Error(const EcmaVM *vm, Local message); @@ -1939,7 +1918,7 @@ public: static void SwitchContext(const EcmaVM *vm, const Local &context); // 1.2runtime interface info static Local GetImplements(const EcmaVM *vm, Local instance); - + JSNAPI_PUBLIC_HYBRID_EXTENSION(); private: static bool isForked_; diff --git a/ecmascript/napi/jsnapi_expo.cpp b/ecmascript/napi/jsnapi_expo.cpp index fcf93e4412c1f82e0f091838e39b4d8c25507454..1760050ea1088acbe4779f6b3e9606d566a0c8ed 100644 --- a/ecmascript/napi/jsnapi_expo.cpp +++ b/ecmascript/napi/jsnapi_expo.cpp @@ -841,24 +841,6 @@ bool JSValueRef::IsJSSharedUint32Array(const EcmaVM *vm) return JSNApiHelper::ToJSTaggedValue(this).IsJSSharedUint32Array(); } -bool JSValueRef::IsJSSharedFloat64Array(const EcmaVM *vm) -{ - ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); - return JSNApiHelper::ToJSTaggedValue(this).IsJSSharedFloat64Array(); -} - -bool JSValueRef::IsJSSharedBigInt64Array(const EcmaVM *vm) -{ - ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); - return JSNApiHelper::ToJSTaggedValue(this).IsJSSharedBigInt64Array(); -} - -bool JSValueRef::IsJSSharedBigUint64Array(const EcmaVM *vm) -{ - ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); - return JSNApiHelper::ToJSTaggedValue(this).IsJSSharedBigUint64Array(); -} - bool JSValueRef::IsJSPrimitiveRef(const EcmaVM *vm) { ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); diff --git a/ecmascript/napi/jsnapi_helper.h b/ecmascript/napi/jsnapi_helper.h index e864176acb2c811bf39d4170bd7df8071e3c165a..86ea7f4e9811a2b0c2a95be08e4a26e3b70e94bc 100644 --- a/ecmascript/napi/jsnapi_helper.h +++ b/ecmascript/napi/jsnapi_helper.h @@ -122,10 +122,7 @@ V(SharedInt32Array) \ V(SharedUint32Array) \ V(SharedUint8ClampedArray) \ - V(SharedFloat32Array) \ - V(SharedFloat64Array) \ - V(SharedBigInt64Array) \ - V(SharedBigUint64Array) + V(SharedFloat32Array) // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) #define EXCEPTION_ERROR_ALL(V) \ diff --git a/ecmascript/napi/test/jsnapi_sendable_tests.cpp b/ecmascript/napi/test/jsnapi_sendable_tests.cpp index e55594d86375e44e3997f2c5085f1f68fa0bd90b..39c861d972b14e3df92ff141279c19464a65b29c 100644 --- a/ecmascript/napi/test/jsnapi_sendable_tests.cpp +++ b/ecmascript/napi/test/jsnapi_sendable_tests.cpp @@ -628,7 +628,7 @@ HWTEST_F_L0(JSNApiTests, NapiHasOwnProperty) Local value2 = ObjectRef::New(vm_); object->Set(vm_, key, value2); object->Set(vm_, key2, value2); - + Local flag = JSNApi::NapiHasOwnProperty(vm_, reinterpret_cast(*object), reinterpret_cast(*key)); ASSERT_TRUE(flag->BooleaValue(vm_)); @@ -666,46 +666,4 @@ HWTEST_F_L0(JSNApiTests, JSNApi_DeserializeValue_String) ASSERT_FALSE(local->IsObject(vm_)); } -HWTEST_F_L0(JSNApiTests, NewSharedFloat64Array) -{ - LocalScope scope(vm_); - Local buffer = SendableArrayBufferRef::New(vm_, 57); - ASSERT_TRUE(buffer->IsSendableArrayBuffer(vm_)); - - Local typedArray = SharedFloat64ArrayRef::New(vm_, buffer, 8, 6); - ASSERT_TRUE(typedArray->IsJSSharedFloat64Array(vm_)); - ASSERT_EQ(typedArray->ByteLength(vm_), 48U); // 48 : length of bytes - ASSERT_EQ(typedArray->ByteOffset(vm_), 8U); // 8 : offset of byte - ASSERT_EQ(typedArray->ArrayLength(vm_), 6U); // 6 : length of array - ASSERT_EQ(typedArray->GetArrayBuffer(vm_)->GetBuffer(vm_), buffer->GetBuffer(vm_)); -} - -HWTEST_F_L0(JSNApiTests, NewSharedBigInt64Array) -{ - LocalScope scope(vm_); - Local buffer = SendableArrayBufferRef::New(vm_, 57); - ASSERT_TRUE(buffer->IsSendableArrayBuffer(vm_)); - - Local typedArray = SharedBigInt64ArrayRef::New(vm_, buffer, 8, 6); - ASSERT_TRUE(typedArray->IsJSSharedBigInt64Array(vm_)); - ASSERT_EQ(typedArray->ByteLength(vm_), 48U); // 48 : length of bytes - ASSERT_EQ(typedArray->ByteOffset(vm_), 8U); // 8 : offset of byte - ASSERT_EQ(typedArray->ArrayLength(vm_), 6U); // 6 : length of array - ASSERT_EQ(typedArray->GetArrayBuffer(vm_)->GetBuffer(vm_), buffer->GetBuffer(vm_)); -} - -HWTEST_F_L0(JSNApiTests, NewSharedBigUint64Array) -{ - LocalScope scope(vm_); - Local buffer = SendableArrayBufferRef::New(vm_, 57); - ASSERT_TRUE(buffer->IsSendableArrayBuffer(vm_)); - - Local typedArray = SharedBigUint64ArrayRef::New(vm_, buffer, 8, 6); - ASSERT_TRUE(typedArray->IsJSSharedBigUint64Array(vm_)); - ASSERT_EQ(typedArray->ByteLength(vm_), 48U); // 48 : length of bytes - ASSERT_EQ(typedArray->ByteOffset(vm_), 8U); // 8 : offset of byte - ASSERT_EQ(typedArray->ArrayLength(vm_), 6U); // 6 : length of array - ASSERT_EQ(typedArray->GetArrayBuffer(vm_)->GetBuffer(vm_), buffer->GetBuffer(vm_)); -} - } // namespace panda::test