Skip to content

Commit

Permalink
lib: add String primordials
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastien-Ahkrin committed May 29, 2020
1 parent c095808 commit b29beef
Show file tree
Hide file tree
Showing 17 changed files with 28 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 @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/_http_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const {
ObjectAssign,
ObjectKeys,
ObjectSetPrototypeOf,
String,
Symbol
} = primordials;

Expand Down
1 change: 1 addition & 0 deletions lib/assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const {
Map,
NumberIsNaN,
RegExpPrototypeTest,
String,
} = primordials;

const { Buffer } = require('buffer');
Expand Down
1 change: 1 addition & 0 deletions lib/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const {
PromiseResolve,
ReflectApply,
ReflectOwnKeys,
String,
Symbol,
SymbolFor,
SymbolAsyncIterator
Expand Down
1 change: 1 addition & 0 deletions lib/internal/assert/assertion_error.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const {
ObjectDefineProperty,
ObjectGetPrototypeOf,
ObjectKeys,
String,
} = primordials;

const { inspect } = require('internal/util/inspect');
Expand Down
1 change: 1 addition & 0 deletions lib/internal/bootstrap/loaders.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const {
ObjectPrototypeHasOwnProperty,
ReflectGet,
SafeSet,
String,
} = primordials;

// Set up process.moduleLoadList.
Expand Down
4 changes: 4 additions & 0 deletions lib/internal/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ const {
NumberIsInteger,
ObjectDefineProperty,
ObjectKeys,
<<<<<<< HEAD
StringPrototypeSlice,
StringPrototypeStartsWith,
=======
String,
>>>>>>> lib: add String primordials
Symbol,
SymbolFor,
WeakMap,
Expand Down
1 change: 1 addition & 0 deletions lib/internal/http2/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const {
ObjectCreate,
ObjectKeys,
Set,
String,
Symbol,
} = primordials;

Expand Down
3 changes: 3 additions & 0 deletions lib/internal/modules/cjs/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ const {
ReflectSet,
RegExpPrototypeTest,
SafeMap,
<<<<<<< HEAD
SafeWeakMap,
=======
>>>>>>> lib: add String primordials
String,
StringPrototypeIndexOf,
StringPrototypeLastIndexOf,
Expand Down
1 change: 1 addition & 0 deletions lib/internal/process/warning.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
const {
ArrayIsArray,
Error,
String,
} = primordials;

const assert = require('internal/assert');
Expand Down
6 changes: 6 additions & 0 deletions lib/internal/readline/utils.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
'use strict';

const {
<<<<<<< HEAD
Symbol,
=======
Boolean,
NumberIsInteger,
String,
>>>>>>> lib: add String primordials
} = primordials;

const kUTF16SurrogateThreshold = 0x10000; // 2 ** 16
Expand Down
1 change: 1 addition & 0 deletions lib/internal/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const {
ObjectKeys,
ReflectGetOwnPropertyDescriptor,
ReflectOwnKeys,
String,
Symbol,
SymbolIterator,
SymbolToStringTag,
Expand Down
1 change: 1 addition & 0 deletions lib/internal/util/inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const {
Set,
SetPrototype,
SetPrototypeValues,
String,
StringPrototypeValueOf,
SymbolPrototypeToString,
SymbolPrototypeValueOf,
Expand Down
1 change: 1 addition & 0 deletions lib/internal/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const {
ObjectEntries,
Promise,
PromiseResolve,
String,
Symbol,
SymbolFor,
} = primordials;
Expand Down
1 change: 1 addition & 0 deletions lib/querystring.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const {
ArrayIsArray,
ObjectCreate,
ObjectKeys,
String,
} = primordials;

const { Buffer } = require('buffer');
Expand Down
1 change: 1 addition & 0 deletions lib/tls.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const {
ArrayIsArray,
ObjectDefineProperty,
ObjectFreeze,
String,
} = primordials;

const {
Expand Down
1 change: 1 addition & 0 deletions lib/wasi.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const {
ArrayPrototypePush,
FunctionPrototypeBind,
ObjectEntries,
String,
Symbol,
} = primordials;

Expand Down

0 comments on commit b29beef

Please sign in to comment.