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." message: "Use `const { Boolean } = primordials;` instead of the global."
- name: Error - name: Error
message: "Use `const { Error } = primordials;` instead of the global." message: "Use `const { Error } = primordials;` instead of the global."
- name: Float32Array
message: "Use `const { Float32Array } = primordials;` instead of the global."
- name: JSON - name: JSON
message: "Use `const { JSON } = primordials;` instead of the global." message: "Use `const { JSON } = primordials;` instead of the global."
- name: Map - name: Map

View File

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

View File

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