lib: use `Float16Array` from primordials · nodejs/node@d34c3af · GitHub
Skip to content

Commit d34c3af

Browse files
committed
lib: use Float16Array from primordials
PR-URL: #65702 Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent 0e1443b commit d34c3af

5 files changed

Lines changed: 9 additions & 14 deletions

File tree

‎lib/eslint.config_partial.mjs‎

Lines changed: 1 addition & 6 deletions

‎lib/internal/freeze_intrinsics.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ const {
5454
EvalErrorPrototype,
5555
FinalizationRegistry,
5656
FinalizationRegistryPrototype,
57+
Float16Array,
58+
Float16ArrayPrototype,
5759
Float32Array,
5860
Float32ArrayPrototype,
5961
Float64Array,
@@ -196,6 +198,7 @@ module.exports = function() {
196198
Uint16ArrayPrototype,
197199
Int32ArrayPrototype,
198200
Uint32ArrayPrototype,
201+
Float16ArrayPrototype,
199202
Float32ArrayPrototype,
200203
Float64ArrayPrototype,
201204
BigInt64ArrayPrototype,
@@ -296,6 +299,7 @@ module.exports = function() {
296299
Uint16Array,
297300
Int32Array,
298301
Uint32Array,
302+
Float16Array,
299303
Float32Array,
300304
Float64Array,
301305
BigInt64Array,

‎lib/internal/per_context/primordials.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ function copyPrototype(src, dest, prefix) {
196196
'Error',
197197
'EvalError',
198198
'FinalizationRegistry',
199+
'Float16Array',
199200
'Float32Array',
200201
'Float64Array',
201202
'Function',

‎lib/internal/util/comparisons.js‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const {
1515
Date,
1616
DatePrototypeGetTime,
1717
Error,
18+
Float16Array,
1819
Float32Array,
1920
Float64Array,
2021
Function,
@@ -50,7 +51,6 @@ const {
5051
Uint8ClampedArray,
5152
WeakMap,
5253
WeakSet,
53-
globalThis: { Float16Array },
5454
} = primordials;
5555

5656
const { compare } = internalBinding('buffer');
@@ -70,6 +70,7 @@ const wellKnownConstructors = new SafeSet()
7070
.add(DataView)
7171
.add(Date)
7272
.add(Error)
73+
.add(Float16Array)
7374
.add(Float32Array)
7475
.add(Float64Array)
7576
.add(Function)
@@ -91,10 +92,6 @@ const wellKnownConstructors = new SafeSet()
9192
.add(WeakMap)
9293
.add(WeakSet);
9394

94-
if (Float16Array) { // TODO(BridgeAR): Remove when Flag got removed from V8
95-
wellKnownConstructors.add(Float16Array);
96-
}
97-
9895
const types = require('internal/util/types');
9996
const {
10097
isAnyArrayBuffer,

‎lib/v8.js‎

Lines changed: 1 addition & 3 deletions

0 commit comments

Comments
 (0)