From 6c6738a89deda1abda6e2add2ca3916b6a62e3f2 Mon Sep 17 00:00:00 2001 From: Kenta Moriuchi Date: Sat, 30 Apr 2022 12:04:13 +0900 Subject: [PATCH] Refactor --- src/Float16Array.mjs | 5 +++-- src/_util/primordials.mjs | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Float16Array.mjs b/src/Float16Array.mjs index b2eec174..3bd309ea 100644 --- a/src/Float16Array.mjs +++ b/src/Float16Array.mjs @@ -31,6 +31,7 @@ import { ArrayPrototypeSlice, ArrayPrototypeToLocaleString, NativeArrayBuffer, + NativeNumber, NativeObject, NativeProxy, NativeRangeError, @@ -39,7 +40,6 @@ import { NativeWeakMap, NativeWeakSet, NumberIsNaN, - NumberMAX_SAFE_INTEGER, ObjectDefineProperty, ObjectFreeze, ObjectHasOwn, @@ -86,6 +86,7 @@ import { } from "./_util/spec.mjs"; const BYTES_PER_ELEMENT = 2; +const { MAX_SAFE_INTEGER } = NativeNumber; /** @typedef {Uint16Array & { __float16bits: never }} Float16BitsArray */ @@ -1069,7 +1070,7 @@ export class Float16Array { // don't use SpeciesConstructor const newLength = length + insertCount - actualDeleteCount; - if (newLength > NumberMAX_SAFE_INTEGER) { + if (newLength > MAX_SAFE_INTEGER) { throw NativeTypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED); } const proxy = new Float16Array(newLength); diff --git a/src/_util/primordials.mjs b/src/_util/primordials.mjs index cf2494fe..f3e1a46c 100644 --- a/src/_util/primordials.mjs +++ b/src/_util/primordials.mjs @@ -42,7 +42,6 @@ export const NativeNumber = Number; export const { isFinite: NumberIsFinite, isNaN: NumberIsNaN, - MAX_SAFE_INTEGER: NumberMAX_SAFE_INTEGER, } = NativeNumber; // Symbol