Skip to content

Commit bc4cbe3

Browse files
Sebastien-Ahkrincodebytere
authored andcommitted
lib: add RegExp primordials
PR-URL: #31208 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
1 parent a91a824 commit bc4cbe3

File tree

7 files changed

+9
-0
lines changed

7 files changed

+9
-0
lines changed

lib/.eslintrc.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ rules:
3535
message: "Use `const { Promise } = primordials;` instead of the global."
3636
- name: Reflect
3737
message: "Use `const { Reflect } = primordials;` instead of the global."
38+
- name: RegExp
39+
message: "Use `const { RegExp } = primordials;` instead of the global."
3840
- name: Set
3941
message: "Use `const { Set } = primordials;` instead of the global."
4042
- name: Symbol

lib/_tls_wrap.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const {
2525
ObjectAssign,
2626
ObjectDefineProperty,
2727
ObjectSetPrototypeOf,
28+
RegExp,
2829
Symbol,
2930
} = primordials;
3031

lib/internal/net.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use strict';
22

33
const {
4+
RegExp,
45
Symbol,
56
} = primordials;
67

lib/internal/policy/sri.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const {
55
ObjectDefineProperty,
66
ObjectFreeze,
77
ObjectSeal,
8+
RegExp,
89
RegExpPrototypeExec,
910
RegExpPrototypeTest,
1011
StringPrototypeSlice,

lib/internal/util/debuglog.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
const { format } = require('internal/util/inspect');
44

5+
const { RegExp } = primordials;
6+
57
// `debugs` is deliberately initialized to undefined so any call to
68
// debuglog() before initializeDebugEnv() is called will throw.
79
let debugs;

lib/internal/util/inspect.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const {
3535
ObjectPrototypeHasOwnProperty,
3636
ObjectPrototypePropertyIsEnumerable,
3737
ObjectSeal,
38+
RegExp,
3839
RegExpPrototypeToString,
3940
Set,
4041
SetPrototype,

lib/repl.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ const {
5858
ObjectSetPrototypeOf,
5959
Promise,
6060
PromiseRace,
61+
RegExp,
6162
Set,
6263
Symbol,
6364
WeakMap,

0 commit comments

Comments
 (0)