diff --git a/lib/.eslintrc.yaml b/lib/.eslintrc.yaml index 16ab2f5028572a..4344e4a461b701 100644 --- a/lib/.eslintrc.yaml +++ b/lib/.eslintrc.yaml @@ -35,6 +35,8 @@ rules: message: "Use `const { Promise } = primordials;` instead of the global." - name: Reflect message: "Use `const { Reflect } = primordials;` instead of the global." + - name: RegExp + message: "Use `const { RegExp } = primordials;` instead of the global." - name: Set message: "Use `const { Set } = primordials;` instead of the global." - name: Symbol diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index 47a59c02fc5552..aeb1cfe7af9682 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -25,6 +25,7 @@ const { ObjectAssign, ObjectDefineProperty, ObjectSetPrototypeOf, + RegExp, Symbol, SymbolFor, } = primordials; diff --git a/lib/internal/net.js b/lib/internal/net.js index 5f6e476b58295d..728c6f587a82f7 100644 --- a/lib/internal/net.js +++ b/lib/internal/net.js @@ -1,6 +1,7 @@ 'use strict'; const { + RegExp, Symbol, } = primordials; diff --git a/lib/internal/policy/sri.js b/lib/internal/policy/sri.js index 38d7fc9e07d741..d70df5c1aa1f7b 100644 --- a/lib/internal/policy/sri.js +++ b/lib/internal/policy/sri.js @@ -5,6 +5,7 @@ const { ObjectDefineProperty, ObjectFreeze, ObjectSeal, + RegExp, RegExpPrototypeExec, RegExpPrototypeTest, StringPrototypeSlice, diff --git a/lib/internal/readline/utils.js b/lib/internal/readline/utils.js index ee3a477744d10e..3ff50124e74e70 100644 --- a/lib/internal/readline/utils.js +++ b/lib/internal/readline/utils.js @@ -3,6 +3,7 @@ const { Boolean, NumberIsInteger, + RegExp, } = primordials; // Regex used for ansi escape code splitting diff --git a/lib/internal/util/debuglog.js b/lib/internal/util/debuglog.js index 9834668307da0c..72eb797474ab59 100644 --- a/lib/internal/util/debuglog.js +++ b/lib/internal/util/debuglog.js @@ -1,5 +1,9 @@ 'use strict'; +const { + RegExp, +} = primordials; + const { inspect, format, formatWithOptions } = require('internal/util/inspect'); // `debugs` is deliberately initialized to undefined so any call to diff --git a/lib/internal/util/inspect.js b/lib/internal/util/inspect.js index fbe943bf4faabe..b4a253952f3db8 100644 --- a/lib/internal/util/inspect.js +++ b/lib/internal/util/inspect.js @@ -35,6 +35,7 @@ const { ObjectPrototypeHasOwnProperty, ObjectPrototypePropertyIsEnumerable, ObjectSeal, + RegExp, RegExpPrototypeToString, Set, SetPrototype, diff --git a/lib/repl.js b/lib/repl.js index 96029783c20e1b..7ec18b73aa25fe 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -56,6 +56,7 @@ const { ObjectSetPrototypeOf, Promise, PromiseRace, + RegExp, Set, Symbol, WeakSet,