Skip to content

Commit 30c6b3e

Browse files
Sebastien-AhkrinBethGriggs
authored andcommitted
lib: replace String global with primordials
PR-URL: #35397 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Pranshu Srivastava <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Anto Aravinth <[email protected]> Reviewed-By: Ujjwal Sharma <[email protected]>
1 parent ebf3900 commit 30c6b3e

File tree

18 files changed

+32
-4
lines changed

18 files changed

+32
-4
lines changed

lib/.eslintrc.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ rules:
4949
message: "Use `const { RegExp } = primordials;` instead of the global."
5050
- name: Set
5151
message: "Use `const { Set } = primordials;` instead of the global."
52+
- name: String
53+
message: "Use `const { String } = primordials;` instead of the global."
5254
- name: Symbol
5355
message: "Use `const { Symbol } = primordials;` instead of the global."
5456
- name: Uint16Array

lib/_http_client.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const {
2929
ObjectAssign,
3030
ObjectKeys,
3131
ObjectSetPrototypeOf,
32+
String,
3233
Symbol
3334
} = primordials;
3435

lib/assert.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const {
2929
Map,
3030
NumberIsNaN,
3131
RegExpPrototypeTest,
32+
String,
3233
} = primordials;
3334

3435
const { Buffer } = require('buffer');

lib/events.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const {
3535
PromiseResolve,
3636
ReflectApply,
3737
ReflectOwnKeys,
38+
String,
3839
Symbol,
3940
SymbolFor,
4041
SymbolAsyncIterator

lib/internal/assert/assertion_error.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const {
77
ObjectDefineProperty,
88
ObjectGetPrototypeOf,
99
ObjectKeys,
10+
String,
1011
} = primordials;
1112

1213
const { inspect } = require('internal/util/inspect');

lib/internal/bootstrap/loaders.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ const {
5252
ObjectPrototypeHasOwnProperty,
5353
ReflectGet,
5454
SafeSet,
55+
String,
5556
} = primordials;
5657

5758
// Set up process.moduleLoadList.

lib/internal/errors.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const {
2121
NumberIsInteger,
2222
ObjectDefineProperty,
2323
ObjectKeys,
24+
String,
2425
StringPrototypeStartsWith,
2526
Symbol,
2627
SymbolFor,

lib/internal/event_target.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const {
88
NumberIsInteger,
99
Object,
1010
ObjectDefineProperty,
11+
String,
1112
Symbol,
1213
SymbolFor,
1314
SymbolToStringTag,

lib/internal/http2/util.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const {
88
ObjectCreate,
99
ObjectKeys,
1010
Set,
11+
String,
1112
Symbol,
1213
} = primordials;
1314

lib/internal/process/warning.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
const {
44
ArrayIsArray,
55
Error,
6+
String,
67
} = primordials;
78

89
const assert = require('internal/assert');

0 commit comments

Comments
 (0)