Skip to content

Commit 2e81795

Browse files
committed
lib: enforce use of Boolean from primordials
Refs: #30697 PR-URL: #30698 Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]>
1 parent 61bb7b9 commit 2e81795

File tree

9 files changed

+20
-0
lines changed

9 files changed

+20
-0
lines changed

lib/.eslintrc.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ rules:
1111
- error
1212
- name: Array
1313
message: "Use `const { Array } = primordials;` instead of the global."
14+
- name: Boolean
15+
message: "Use `const { Boolean } = primordials;` instead of the global."
1416
- name: JSON
1517
message: "Use `const { JSON } = primordials;` instead of the global."
1618
- name: Math

lib/_http_client.js

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
const {
2525
ArrayIsArray,
26+
Boolean,
2627
ObjectAssign,
2728
ObjectKeys,
2829
ObjectSetPrototypeOf,

lib/internal/cluster/round_robin_handle.js

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
'use strict';
2+
3+
const {
4+
Boolean,
5+
} = primordials;
6+
27
const assert = require('internal/assert');
38
const net = require('net');
49
const { sendHelper } = require('internal/cluster/utils');

lib/internal/console/constructor.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
const {
77
ArrayFrom,
88
ArrayIsArray,
9+
Boolean,
910
ObjectDefineProperties,
1011
ObjectDefineProperty,
1112
ObjectKeys,

lib/internal/http2/compat.js

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
const {
44
ArrayIsArray,
5+
Boolean,
56
ObjectAssign,
67
ObjectCreate,
78
ObjectKeys,

lib/internal/readline/utils.js

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
'use strict';
22

3+
const {
4+
Boolean,
5+
} = primordials;
6+
37
// Regex used for ansi escape code splitting
48
// Adopted from https://github.com/chalk/ansi-regex/blob/master/index.js
59
// License: MIT, authors: @sindresorhus, Qix-, and arjunmehta

lib/internal/repl/history.js

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
'use strict';
22

3+
const {
4+
Boolean,
5+
} = primordials;
6+
37
const { Interface } = require('readline');
48
const path = require('path');
59
const fs = require('fs');

lib/net.js

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
const {
2525
ArrayIsArray,
26+
Boolean,
2627
ObjectDefineProperty,
2728
ObjectSetPrototypeOf,
2829
} = primordials;

lib/perf_hooks.js

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
const {
44
ArrayIsArray,
5+
Boolean,
56
ObjectDefineProperties,
67
ObjectDefineProperty,
78
ObjectKeys,

0 commit comments

Comments
 (0)