diff --git a/lib/.eslintrc.yaml b/lib/.eslintrc.yaml index 16ab2f50285..4344e4a461b 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 47a59c02fc5..aeb1cfe7af9 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 5f6e476b582..728c6f587a8 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 38d7fc9e07d..d70df5c1aa1 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 ee3a477744d..3ff50124e74 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 9834668307d..72eb797474a 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 c021d793c95..3f2f75b9096 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 9fda04406ec..94457557c86 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -56,6 +56,7 @@ const { ObjectSetPrototypeOf, Promise, PromiseRace, + RegExp, Set, Symbol, WeakSet,