lib: replace Float32Array global by the primordials

PR-URL: https://github.com/nodejs/node/pull/31195
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
Sebastien Ahkrin 2020-01-05 14:17:14 +01:00 committed by Rich Trott
parent 4f51c12d41
commit 92cef79779
3 changed files with 4 additions and 0 deletions

View File

@ -19,6 +19,8 @@ rules:
message: "Use `const { Boolean } = primordials;` instead of the global."
- name: Error
message: "Use `const { Error } = primordials;` instead of the global."
- name: Float32Array
message: "Use `const { Float32Array } = primordials;` instead of the global."
- name: JSON
message: "Use `const { JSON } = primordials;` instead of the global."
- name: Map

View File

@ -2,6 +2,7 @@
const {
BigInt,
Float32Array,
MathFloor,
Number,
} = primordials;

View File

@ -10,6 +10,7 @@ const {
DatePrototypeToISOString,
DatePrototypeToString,
ErrorPrototypeToString,
Float32Array,
JSONStringify,
Map,
MapPrototype,