summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2019-11-28 08:19:55 +0100
committerMichaël Zasso <targos@protonmail.com>2019-11-30 13:37:23 +0100
commit7fc5980cfe79c9b7ff19837397823a583c9fd8fe (patch)
treecf999c713248005a8bfa273ac6a6af71535a8e80
parent0da6983cdad80dad8c1d4155b1bc887ce37d9c40 (diff)
downloadandroid-node-v8-7fc5980cfe79c9b7ff19837397823a583c9fd8fe.tar.gz
android-node-v8-7fc5980cfe79c9b7ff19837397823a583c9fd8fe.tar.bz2
android-node-v8-7fc5980cfe79c9b7ff19837397823a583c9fd8fe.zip
lib: enforce use of Boolean from primordials
Refs: https://github.com/nodejs/node/issues/30697 PR-URL: https://github.com/nodejs/node/pull/30698 Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
-rw-r--r--lib/.eslintrc.yaml2
-rw-r--r--lib/_http_client.js1
-rw-r--r--lib/internal/cluster/round_robin_handle.js5
-rw-r--r--lib/internal/console/constructor.js1
-rw-r--r--lib/internal/http2/compat.js1
-rw-r--r--lib/internal/readline/utils.js4
-rw-r--r--lib/internal/repl/history.js4
-rw-r--r--lib/net.js1
-rw-r--r--lib/perf_hooks.js1
9 files changed, 20 insertions, 0 deletions
diff --git a/lib/.eslintrc.yaml b/lib/.eslintrc.yaml
index 1b75d7e742..d50f6f2f36 100644
--- a/lib/.eslintrc.yaml
+++ b/lib/.eslintrc.yaml
@@ -11,6 +11,8 @@ rules:
- error
- name: Array
message: "Use `const { Array } = primordials;` instead of the global."
+ - name: Boolean
+ message: "Use `const { Boolean } = primordials;` instead of the global."
- name: JSON
message: "Use `const { JSON } = primordials;` instead of the global."
- name: Math
diff --git a/lib/_http_client.js b/lib/_http_client.js
index 7292fd255e..249a6d6028 100644
--- a/lib/_http_client.js
+++ b/lib/_http_client.js
@@ -23,6 +23,7 @@
const {
ArrayIsArray,
+ Boolean,
ObjectAssign,
ObjectKeys,
ObjectSetPrototypeOf,
diff --git a/lib/internal/cluster/round_robin_handle.js b/lib/internal/cluster/round_robin_handle.js
index 6794e8d419..61023b8370 100644
--- a/lib/internal/cluster/round_robin_handle.js
+++ b/lib/internal/cluster/round_robin_handle.js
@@ -1,4 +1,9 @@
'use strict';
+
+const {
+ Boolean,
+} = primordials;
+
const assert = require('internal/assert');
const net = require('net');
const { sendHelper } = require('internal/cluster/utils');
diff --git a/lib/internal/console/constructor.js b/lib/internal/console/constructor.js
index 0e96f16dfd..69dd4a6e4a 100644
--- a/lib/internal/console/constructor.js
+++ b/lib/internal/console/constructor.js
@@ -6,6 +6,7 @@
const {
ArrayFrom,
ArrayIsArray,
+ Boolean,
MathFloor,
ObjectDefineProperties,
ObjectDefineProperty,
diff --git a/lib/internal/http2/compat.js b/lib/internal/http2/compat.js
index b8d7dadb94..6a55b4edd1 100644
--- a/lib/internal/http2/compat.js
+++ b/lib/internal/http2/compat.js
@@ -2,6 +2,7 @@
const {
ArrayIsArray,
+ Boolean,
ObjectAssign,
ObjectCreate,
ObjectKeys,
diff --git a/lib/internal/readline/utils.js b/lib/internal/readline/utils.js
index b6957f6e8a..27110f8279 100644
--- a/lib/internal/readline/utils.js
+++ b/lib/internal/readline/utils.js
@@ -1,5 +1,9 @@
'use strict';
+const {
+ Boolean,
+} = primordials;
+
// Regex used for ansi escape code splitting
// Adopted from https://github.com/chalk/ansi-regex/blob/master/index.js
// License: MIT, authors: @sindresorhus, Qix-, and arjunmehta
diff --git a/lib/internal/repl/history.js b/lib/internal/repl/history.js
index 1af974e83e..6404e821b1 100644
--- a/lib/internal/repl/history.js
+++ b/lib/internal/repl/history.js
@@ -1,5 +1,9 @@
'use strict';
+const {
+ Boolean,
+} = primordials;
+
const { Interface } = require('readline');
const path = require('path');
const fs = require('fs');
diff --git a/lib/net.js b/lib/net.js
index 8fb5d2cd13..3370ecf117 100644
--- a/lib/net.js
+++ b/lib/net.js
@@ -23,6 +23,7 @@
const {
ArrayIsArray,
+ Boolean,
ObjectDefineProperty,
ObjectSetPrototypeOf,
} = primordials;
diff --git a/lib/perf_hooks.js b/lib/perf_hooks.js
index 32db324e6b..7121fb3899 100644
--- a/lib/perf_hooks.js
+++ b/lib/perf_hooks.js
@@ -2,6 +2,7 @@
const {
ArrayIsArray,
+ Boolean,
ObjectDefineProperties,
ObjectDefineProperty,
ObjectKeys,