summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorKenta Moriuchi <moriken@kimamass.com>2023-03-01 08:14:16 +0900
committerGitHub <noreply@github.com>2023-03-01 08:14:16 +0900
commit55833cf799979e63c6b027fbbf018272308caf5c (patch)
treecc0ae9aa9116e6296e5e74e1c926cfd94fa26449 /core
parent6ffbf8a9410f5ea41669efdece60f7f47f77e3c7 (diff)
fix(core): introduce `SafeRegExp` to primordials (#17592)
Diffstat (limited to 'core')
-rw-r--r--core/00_primordials.js9
-rw-r--r--core/internal.d.ts1
2 files changed, 10 insertions, 0 deletions
diff --git a/core/00_primordials.js b/core/00_primordials.js
index 6495a5268..243f40e88 100644
--- a/core/00_primordials.js
+++ b/core/00_primordials.js
@@ -434,6 +434,15 @@
},
);
+ primordials.SafeRegExp = makeSafe(
+ RegExp,
+ class SafeRegExp extends RegExp {
+ constructor(pattern, flags) {
+ super(pattern, flags);
+ }
+ },
+ );
+
primordials.SafeFinalizationRegistry = makeSafe(
FinalizationRegistry,
class SafeFinalizationRegistry extends FinalizationRegistry {
diff --git a/core/internal.d.ts b/core/internal.d.ts
index 004e068ff..a91ac6244 100644
--- a/core/internal.d.ts
+++ b/core/internal.d.ts
@@ -78,6 +78,7 @@ declare namespace __bootstrap {
export const SafePromisePrototypeFinally: UncurryThis<
Promise.prototype.finally
>;
+ export const SafeRegExp: typeof RegExp;
// safe iterators
export const SafeArrayIterator: new <T>(array: T[]) => IterableIterator<T>;