Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
petamoriken committed Apr 30, 2022
1 parent 15111e5 commit 6c6738a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/Float16Array.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
ArrayPrototypeSlice,
ArrayPrototypeToLocaleString,
NativeArrayBuffer,
NativeNumber,
NativeObject,
NativeProxy,
NativeRangeError,
Expand All @@ -39,7 +40,6 @@ import {
NativeWeakMap,
NativeWeakSet,
NumberIsNaN,
NumberMAX_SAFE_INTEGER,
ObjectDefineProperty,
ObjectFreeze,
ObjectHasOwn,
Expand Down Expand Up @@ -86,6 +86,7 @@ import {
} from "./_util/spec.mjs";

const BYTES_PER_ELEMENT = 2;
const { MAX_SAFE_INTEGER } = NativeNumber;

/** @typedef {Uint16Array & { __float16bits: never }} Float16BitsArray */

Expand Down Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion src/_util/primordials.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export const NativeNumber = Number;
export const {
isFinite: NumberIsFinite,
isNaN: NumberIsNaN,
MAX_SAFE_INTEGER: NumberMAX_SAFE_INTEGER,
} = NativeNumber;

// Symbol
Expand Down

0 comments on commit 6c6738a

Please sign in to comment.