Skip to content

Commit

Permalink
lib: enforce use of Boolean from primordials
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
targos committed Dec 1, 2019
1 parent ae2c7d0 commit 892bde6
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/.eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/_http_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

const {
ArrayIsArray,
Boolean,
ObjectAssign,
ObjectKeys,
ObjectSetPrototypeOf,
Expand Down
5 changes: 5 additions & 0 deletions lib/internal/cluster/round_robin_handle.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
'use strict';

const {
Boolean,
} = primordials;

const assert = require('internal/assert');
const net = require('net');
const { sendHelper } = require('internal/cluster/utils');
Expand Down
1 change: 1 addition & 0 deletions lib/internal/console/constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
const {
ArrayFrom,
ArrayIsArray,
Boolean,
MathFloor,
ObjectDefineProperties,
ObjectDefineProperty,
Expand Down
1 change: 1 addition & 0 deletions lib/internal/http2/compat.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

const {
ArrayIsArray,
Boolean,
ObjectAssign,
ObjectCreate,
ObjectKeys,
Expand Down
4 changes: 4 additions & 0 deletions lib/internal/readline/utils.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 4 additions & 0 deletions lib/internal/repl/history.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
'use strict';

const {
Boolean,
} = primordials;

const { Interface } = require('readline');
const path = require('path');
const fs = require('fs');
Expand Down
1 change: 1 addition & 0 deletions lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

const {
ArrayIsArray,
Boolean,
ObjectDefineProperty,
ObjectSetPrototypeOf,
} = primordials;
Expand Down
1 change: 1 addition & 0 deletions lib/perf_hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

const {
ArrayIsArray,
Boolean,
ObjectDefineProperties,
ObjectDefineProperty,
ObjectKeys,
Expand Down

0 comments on commit 892bde6

Please sign in to comment.