diff --git a/lib/.eslintrc.yaml b/lib/.eslintrc.yaml index 0592218e5705a7..2cb1651593fd3c 100644 --- a/lib/.eslintrc.yaml +++ b/lib/.eslintrc.yaml @@ -41,6 +41,8 @@ rules: message: "Use `const { RegExp } = primordials;` instead of the global." - name: Set message: "Use `const { Set } = primordials;` instead of the global." + - name: String + message: "Use `const { String } = primordials;` instead of the global." - name: Symbol message: "Use `const { Symbol } = primordials;` instead of the global." - name: Uint16Array diff --git a/lib/_http_client.js b/lib/_http_client.js index 3093047bd731f2..d271a4ae7de1dd 100644 --- a/lib/_http_client.js +++ b/lib/_http_client.js @@ -29,6 +29,7 @@ const { ObjectAssign, ObjectKeys, ObjectSetPrototypeOf, + String, Symbol } = primordials; diff --git a/lib/assert.js b/lib/assert.js index 6ad672d698602d..08ef18240925ba 100644 --- a/lib/assert.js +++ b/lib/assert.js @@ -29,6 +29,7 @@ const { Map, NumberIsNaN, RegExpPrototypeTest, + String, } = primordials; const { Buffer } = require('buffer'); diff --git a/lib/events.js b/lib/events.js index fc2f969ea37ef6..4f625ce115e0f1 100644 --- a/lib/events.js +++ b/lib/events.js @@ -36,6 +36,7 @@ const { PromiseResolve, ReflectApply, ReflectOwnKeys, + String, Symbol, SymbolFor, SymbolAsyncIterator diff --git a/lib/internal/assert/assertion_error.js b/lib/internal/assert/assertion_error.js index 3c2150c69e4e09..c89219eef82224 100644 --- a/lib/internal/assert/assertion_error.js +++ b/lib/internal/assert/assertion_error.js @@ -7,6 +7,7 @@ const { ObjectDefineProperty, ObjectGetPrototypeOf, ObjectKeys, + String, } = primordials; const { inspect } = require('internal/util/inspect'); diff --git a/lib/internal/bootstrap/loaders.js b/lib/internal/bootstrap/loaders.js index c4ef1d12a2974c..127ef67c36eb64 100644 --- a/lib/internal/bootstrap/loaders.js +++ b/lib/internal/bootstrap/loaders.js @@ -52,6 +52,7 @@ const { ObjectPrototypeHasOwnProperty, ReflectGet, SafeSet, + String, } = primordials; // Set up process.moduleLoadList. diff --git a/lib/internal/errors.js b/lib/internal/errors.js index 5af14fe60b0836..136707aed286d0 100644 --- a/lib/internal/errors.js +++ b/lib/internal/errors.js @@ -21,6 +21,7 @@ const { ObjectKeys, StringPrototypeSlice, StringPrototypeStartsWith, + String, Symbol, SymbolFor, WeakMap, diff --git a/lib/internal/event_target.js b/lib/internal/event_target.js index 4cc561f95c0bba..0f4abfe4e9414c 100644 --- a/lib/internal/event_target.js +++ b/lib/internal/event_target.js @@ -6,6 +6,7 @@ const { Map, Object, Set, + String, Symbol, NumberIsNaN, } = primordials; diff --git a/lib/internal/http2/util.js b/lib/internal/http2/util.js index dcc1355a3230fd..a2eb62fa1d0638 100644 --- a/lib/internal/http2/util.js +++ b/lib/internal/http2/util.js @@ -8,6 +8,7 @@ const { ObjectCreate, ObjectKeys, Set, + String, Symbol, } = primordials; diff --git a/lib/internal/process/warning.js b/lib/internal/process/warning.js index 82bff2ece9e146..60048fa175fadb 100644 --- a/lib/internal/process/warning.js +++ b/lib/internal/process/warning.js @@ -3,6 +3,7 @@ const { ArrayIsArray, Error, + String, } = primordials; const assert = require('internal/assert'); diff --git a/lib/internal/readline/utils.js b/lib/internal/readline/utils.js index 0b9fe8cde4f5ce..7a3fa53672f69f 100644 --- a/lib/internal/readline/utils.js +++ b/lib/internal/readline/utils.js @@ -1,6 +1,7 @@ 'use strict'; const { + String, Symbol, } = primordials; diff --git a/lib/internal/url.js b/lib/internal/url.js index c0b8c17d098708..272298334b9ba6 100644 --- a/lib/internal/url.js +++ b/lib/internal/url.js @@ -11,6 +11,7 @@ const { ObjectKeys, ReflectGetOwnPropertyDescriptor, ReflectOwnKeys, + String, Symbol, SymbolIterator, SymbolToStringTag, diff --git a/lib/internal/util/inspect.js b/lib/internal/util/inspect.js index fbc0a4ee2d6b6e..7ad4eb90e7ce52 100644 --- a/lib/internal/util/inspect.js +++ b/lib/internal/util/inspect.js @@ -42,6 +42,7 @@ const { Set, SetPrototype, SetPrototypeValues, + String, StringPrototypeValueOf, SymbolPrototypeToString, SymbolPrototypeValueOf, diff --git a/lib/internal/worker.js b/lib/internal/worker.js index 4f01f331349f4c..a6fd56e9758049 100644 --- a/lib/internal/worker.js +++ b/lib/internal/worker.js @@ -9,6 +9,7 @@ const { ObjectEntries, Promise, PromiseResolve, + String, Symbol, SymbolFor, } = primordials; diff --git a/lib/querystring.js b/lib/querystring.js index 954b35d69e3fbd..260d1eaaef3fa7 100644 --- a/lib/querystring.js +++ b/lib/querystring.js @@ -28,6 +28,7 @@ const { ArrayIsArray, ObjectCreate, ObjectKeys, + String, } = primordials; const { Buffer } = require('buffer'); diff --git a/lib/tls.js b/lib/tls.js index 2ccbe409c96c2d..92e8e07dd3c289 100644 --- a/lib/tls.js +++ b/lib/tls.js @@ -26,6 +26,7 @@ const { ArrayIsArray, ObjectDefineProperty, ObjectFreeze, + String, } = primordials; const { diff --git a/lib/wasi.js b/lib/wasi.js index d3125ca7abd9d2..573b095fc09650 100644 --- a/lib/wasi.js +++ b/lib/wasi.js @@ -4,6 +4,7 @@ const { ArrayPrototypePush, FunctionPrototypeBind, ObjectEntries, + String, Symbol, } = primordials;