mirror of
https://github.com/nodejs/node.git
synced 2026-11-29 14:27:57 -05:00
lib: use Float16Array from primordials
PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
5 files changed
+9
-14
No files matched your search
@@ -412,12 +412,6 @@ export default [
|
||||
name: 'SubtleCrypto',
|
||||
message: "Use `const { SubtleCrypto } = require('internal/crypto/webcrypto');` instead of the global.",
|
||||
},
|
||||
// Float16Array is not available in primordials because it can be
|
||||
// disabled with --no-js-float16array CLI flag.
|
||||
{
|
||||
name: 'Float16Array',
|
||||
message: 'Use `const { Float16Array } = globalThis;` instead of the global.',
|
||||
},
|
||||
// DisposableStack and AsyncDisposableStack are not available in primordials because they can be
|
||||
// disabled with --no-js-explicit-resource-management CLI flag.
|
||||
{
|
||||
@@ -478,6 +472,7 @@ export default [
|
||||
name: 'FinalizationRegistry',
|
||||
into: 'Safe',
|
||||
},
|
||||
{ name: 'Float16Array' },
|
||||
{ name: 'Float32Array' },
|
||||
{ name: 'Float64Array' },
|
||||
{ name: 'Function' },
|
||||
|
||||
@@ -54,6 +54,8 @@ const {
|
||||
EvalErrorPrototype,
|
||||
FinalizationRegistry,
|
||||
FinalizationRegistryPrototype,
|
||||
Float16Array,
|
||||
Float16ArrayPrototype,
|
||||
Float32Array,
|
||||
Float32ArrayPrototype,
|
||||
Float64Array,
|
||||
@@ -196,6 +198,7 @@ module.exports = function() {
|
||||
Uint16ArrayPrototype,
|
||||
Int32ArrayPrototype,
|
||||
Uint32ArrayPrototype,
|
||||
Float16ArrayPrototype,
|
||||
Float32ArrayPrototype,
|
||||
Float64ArrayPrototype,
|
||||
BigInt64ArrayPrototype,
|
||||
@@ -296,6 +299,7 @@ module.exports = function() {
|
||||
Uint16Array,
|
||||
Int32Array,
|
||||
Uint32Array,
|
||||
Float16Array,
|
||||
Float32Array,
|
||||
Float64Array,
|
||||
BigInt64Array,
|
||||
|
||||
@@ -196,6 +196,7 @@ function copyPrototype(src, dest, prefix) {
|
||||
'Error',
|
||||
'EvalError',
|
||||
'FinalizationRegistry',
|
||||
'Float16Array',
|
||||
'Float32Array',
|
||||
'Float64Array',
|
||||
'Function',
|
||||
|
||||
@@ -15,6 +15,7 @@ const {
|
||||
Date,
|
||||
DatePrototypeGetTime,
|
||||
Error,
|
||||
Float16Array,
|
||||
Float32Array,
|
||||
Float64Array,
|
||||
Function,
|
||||
@@ -50,7 +51,6 @@ const {
|
||||
Uint8ClampedArray,
|
||||
WeakMap,
|
||||
WeakSet,
|
||||
globalThis: { Float16Array },
|
||||
} = primordials;
|
||||
|
||||
const { compare } = internalBinding('buffer');
|
||||
@@ -70,6 +70,7 @@ const wellKnownConstructors = new SafeSet()
|
||||
.add(DataView)
|
||||
.add(Date)
|
||||
.add(Error)
|
||||
.add(Float16Array)
|
||||
.add(Float32Array)
|
||||
.add(Float64Array)
|
||||
.add(Function)
|
||||
@@ -91,10 +92,6 @@ const wellKnownConstructors = new SafeSet()
|
||||
.add(WeakMap)
|
||||
.add(WeakSet);
|
||||
|
||||
if (Float16Array) { // TODO(BridgeAR): Remove when Flag got removed from V8
|
||||
wellKnownConstructors.add(Float16Array);
|
||||
}
|
||||
|
||||
const types = require('internal/util/types');
|
||||
const {
|
||||
isAnyArrayBuffer,
|
||||
|
||||
Reference in new issue
Block a user