From 41f0fa742e4c2ceb4bd3e9e317c715bd4734b934 Mon Sep 17 00:00:00 2001 From: Sebastien Ahkrin Date: Sun, 5 Jan 2020 14:17:14 +0100 Subject: [PATCH] lib: replace Float32Array global by the primordials MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/31195 Reviewed-By: Trivikram Kamat Reviewed-By: Michaƫl Zasso Reviewed-By: Colin Ihrig Reviewed-By: Jiawen Geng Reviewed-By: James M Snell Reviewed-By: Ruben Bridgewater Reviewed-By: Rich Trott --- lib/.eslintrc.yaml | 2 ++ lib/internal/buffer.js | 1 + lib/internal/util/inspect.js | 1 + 3 files changed, 4 insertions(+) diff --git a/lib/.eslintrc.yaml b/lib/.eslintrc.yaml index 17d3551b86adbb..16ab2f5028572a 100644 --- a/lib/.eslintrc.yaml +++ b/lib/.eslintrc.yaml @@ -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 diff --git a/lib/internal/buffer.js b/lib/internal/buffer.js index ff703f11fd648e..c344a994181b9b 100644 --- a/lib/internal/buffer.js +++ b/lib/internal/buffer.js @@ -2,6 +2,7 @@ const { BigInt, + Float32Array, MathFloor, Number, } = primordials; diff --git a/lib/internal/util/inspect.js b/lib/internal/util/inspect.js index a836ddf981d199..7329940798845e 100644 --- a/lib/internal/util/inspect.js +++ b/lib/internal/util/inspect.js @@ -10,6 +10,7 @@ const { DatePrototypeToISOString, DatePrototypeToString, ErrorPrototypeToString, + Float32Array, JSONStringify, Map, MapPrototype,