From 89620dd6f3875434fe59ae879d298201e481718b Mon Sep 17 00:00:00 2001 From: Yulong Wang Date: Sat, 18 Apr 2020 12:00:47 -0700 Subject: [PATCH 1/3] support bigint64/biguint64 in TypedArray::ElementSize() --- napi-inl.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/napi-inl.h b/napi-inl.h index f8657ae3f..52ee717b2 100644 --- a/napi-inl.h +++ b/napi-inl.h @@ -1628,6 +1628,10 @@ inline uint8_t TypedArray::ElementSize() const { case napi_float32_array: return 4; case napi_float64_array: +#ifdef NAPI_EXPERIMENTAL + case napi_bigint64_array: + case napi_biguint64_array: +#endif // NAPI_EXPERIMENTAL return 8; default: return 0; From c99502ed73370d0dd1ab5a61a40e68fe5a545c94 Mon Sep 17 00:00:00 2001 From: Yulong Wang Date: Mon, 20 Apr 2020 12:07:46 -0700 Subject: [PATCH 2/3] resolve comments --- napi-inl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/napi-inl.h b/napi-inl.h index 52ee717b2..619082a14 100644 --- a/napi-inl.h +++ b/napi-inl.h @@ -1628,10 +1628,10 @@ inline uint8_t TypedArray::ElementSize() const { case napi_float32_array: return 4; case napi_float64_array: -#ifdef NAPI_EXPERIMENTAL +#if (NAPI_VERSION > 5) case napi_bigint64_array: case napi_biguint64_array: -#endif // NAPI_EXPERIMENTAL +#endif return 8; default: return 0; From 3b266f24a2f91c07c0660b7a89fd466777fd5654 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Fri, 24 Apr 2020 10:29:26 -0400 Subject: [PATCH 3/3] Update napi-inl.h Co-Authored-By: Gabriel Schulhof --- napi-inl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/napi-inl.h b/napi-inl.h index 619082a14..e7b02b2d2 100644 --- a/napi-inl.h +++ b/napi-inl.h @@ -1631,7 +1631,7 @@ inline uint8_t TypedArray::ElementSize() const { #if (NAPI_VERSION > 5) case napi_bigint64_array: case napi_biguint64_array: -#endif +#endif // (NAPI_VERSION > 5) return 8; default: return 0;