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 0207d9bfd6c152..c8ccbdb84286a4 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -25,6 +25,7 @@ const { ObjectAssign, ObjectDefineProperty, ObjectSetPrototypeOf, + RegExp, Symbol, } = primordials; diff --git a/lib/internal/net.js b/lib/internal/net.js index 28f4e696cda689..73acaa5efee654 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/util/debuglog.js b/lib/internal/util/debuglog.js index 87af5de8339b87..21d52910912e8d 100644 --- a/lib/internal/util/debuglog.js +++ b/lib/internal/util/debuglog.js @@ -2,6 +2,8 @@ const { format } = require('internal/util/inspect'); +const { RegExp } = primordials; + // `debugs` is deliberately initialized to undefined so any call to // debuglog() before initializeDebugEnv() is called will throw. let debugs; diff --git a/lib/internal/util/inspect.js b/lib/internal/util/inspect.js index 7329940798845e..7f589eebe33c1c 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 a0f11c8eeb95d8..420b9558f99700 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -58,6 +58,7 @@ const { ObjectSetPrototypeOf, Promise, PromiseRace, + RegExp, Set, Symbol, WeakMap,