You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by do...@apache.org on 2023/06/27 00:03:47 UTC

[arrow] branch main updated: GH-36033: [JS] Remove BigInt compat (#36034)

This is an automated email from the ASF dual-hosted git repository.

domoritz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new 7bc7ccaf23 GH-36033: [JS] Remove BigInt compat (#36034)
7bc7ccaf23 is described below

commit 7bc7ccaf23161adf80536ee6a5c3fbda79484db9
Author: Dominik Moritz <do...@gmail.com>
AuthorDate: Mon Jun 26 17:03:41 2023 -0700

    GH-36033: [JS] Remove BigInt compat (#36034)
    
    Closes #36033
    * Closes: #36033
    
    Authored-by: Dominik Moritz <do...@gmail.com>
    Signed-off-by: Dominik Moritz <do...@gmail.com>
---
 js/src/type.ts        |  1 -
 js/src/util/bn.ts     |  1 -
 js/src/util/buffer.ts |  2 +-
 js/src/util/compat.ts | 27 ---------------------------
 js/src/util/pretty.ts |  2 --
 js/src/vector.ts      |  1 -
 6 files changed, 1 insertion(+), 33 deletions(-)

diff --git a/js/src/type.ts b/js/src/type.ts
index a1108eaf22..e3b9c02b5e 100644
--- a/js/src/type.ts
+++ b/js/src/type.ts
@@ -20,7 +20,6 @@ import { Vector } from './vector.js';
 import { MapRow } from './row/map.js';
 import { StructRow, StructRowProxy } from './row/struct.js';
 import { TypedArrayConstructor } from './interfaces.js';
-import { BigInt64Array, BigUint64Array } from './util/compat.js';
 import { bigIntToNumber } from './util/bigint.js';
 
 import {
diff --git a/js/src/util/bn.ts b/js/src/util/bn.ts
index 7c3676438d..af546be543 100644
--- a/js/src/util/bn.ts
+++ b/js/src/util/bn.ts
@@ -18,7 +18,6 @@
 import { ArrayBufferViewInput, toArrayBufferView } from './buffer.js';
 import { TypedArray, TypedArrayConstructor } from '../interfaces.js';
 import { BigIntArray, BigIntArrayConstructor } from '../interfaces.js';
-import { BigInt64Array, BigUint64Array } from './compat.js';
 
 /** @ignore */
 export const isArrowBigNumSymbol = Symbol.for('isArrowBigNum');
diff --git a/js/src/util/buffer.ts b/js/src/util/buffer.ts
index aac64e4074..c3d90ecada 100644
--- a/js/src/util/buffer.ts
+++ b/js/src/util/buffer.ts
@@ -17,7 +17,7 @@
 
 import { encodeUtf8 } from '../util/utf8.js';
 import { TypedArray, TypedArrayConstructor, BigIntArrayConstructor } from '../interfaces.js';
-import { isPromise, isIterable, isAsyncIterable, isIteratorResult, isFlatbuffersByteBuffer, BigInt64Array, BigUint64Array } from './compat.js';
+import { isPromise, isIterable, isAsyncIterable, isIteratorResult, isFlatbuffersByteBuffer } from './compat.js';
 import { ByteBuffer } from 'flatbuffers';
 
 /** @ignore */
diff --git a/js/src/util/compat.ts b/js/src/util/compat.ts
index cdc9492aab..0948e8bea2 100644
--- a/js/src/util/compat.ts
+++ b/js/src/util/compat.ts
@@ -42,33 +42,6 @@ export interface Observable<T> {
     subscribe: (observer: Observer<T>) => Subscription;
 }
 
-/** @ignore */
-const [BigInt64ArrayCtor, BigInt64ArrayAvailable] = (() => {
-    const BigInt64ArrayUnavailableError = () => { throw new Error('BigInt64Array is not available in this environment'); };
-    class BigInt64ArrayUnavailable {
-        static get BYTES_PER_ELEMENT() { return 8; }
-        static of() { throw BigInt64ArrayUnavailableError(); }
-        static from() { throw BigInt64ArrayUnavailableError(); }
-        constructor() { throw BigInt64ArrayUnavailableError(); }
-    }
-    return typeof BigInt64Array !== 'undefined' ? [BigInt64Array, true] : [<any>BigInt64ArrayUnavailable, false];
-})() as [BigInt64ArrayConstructor, boolean];
-
-/** @ignore */
-const [BigUint64ArrayCtor, BigUint64ArrayAvailable] = (() => {
-    const BigUint64ArrayUnavailableError = () => { throw new Error('BigUint64Array is not available in this environment'); };
-    class BigUint64ArrayUnavailable {
-        static get BYTES_PER_ELEMENT() { return 8; }
-        static of() { throw BigUint64ArrayUnavailableError(); }
-        static from() { throw BigUint64ArrayUnavailableError(); }
-        constructor() { throw BigUint64ArrayUnavailableError(); }
-    }
-    return typeof BigUint64Array !== 'undefined' ? [BigUint64Array, true] : [<any>BigUint64ArrayUnavailable, false];
-})() as [BigUint64ArrayConstructor, boolean];
-
-export { BigInt64ArrayCtor as BigInt64Array, BigInt64ArrayAvailable };
-export { BigUint64ArrayCtor as BigUint64Array, BigUint64ArrayAvailable };
-
 /** @ignore */ const isNumber = (x: any) => typeof x === 'number';
 /** @ignore */ const isBoolean = (x: any) => typeof x === 'boolean';
 /** @ignore */ const isFunction = (x: any) => typeof x === 'function';
diff --git a/js/src/util/pretty.ts b/js/src/util/pretty.ts
index de1b77c09a..de8fec3f5c 100644
--- a/js/src/util/pretty.ts
+++ b/js/src/util/pretty.ts
@@ -15,8 +15,6 @@
 // specific language governing permissions and limitations
 // under the License.
 
-import { BigInt64Array, BigUint64Array } from './compat.js';
-
 /** @ignore */ const undf = void (0);
 
 /** @ignore */
diff --git a/js/src/vector.ts b/js/src/vector.ts
index 841e6ea9e2..48d0a1244e 100644
--- a/js/src/vector.ts
+++ b/js/src/vector.ts
@@ -30,7 +30,6 @@ import {
     wrapChunkedCall2,
     wrapChunkedIndexOf,
 } from './util/chunk.js';
-import { BigInt64Array, BigUint64Array } from './util/compat.js';
 
 import { instance as getVisitor } from './visitor/get.js';
 import { instance as setVisitor } from './visitor/set.js';