From 55833cf799979e63c6b027fbbf018272308caf5c Mon Sep 17 00:00:00 2001 From: Kenta Moriuchi Date: Wed, 1 Mar 2023 08:14:16 +0900 Subject: fix(core): introduce `SafeRegExp` to primordials (#17592) --- cli/tests/unit/console_test.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'cli/tests/unit/console_test.ts') diff --git a/cli/tests/unit/console_test.ts b/cli/tests/unit/console_test.ts index 239a8bf26..2b7426b99 100644 --- a/cli/tests/unit/console_test.ts +++ b/cli/tests/unit/console_test.ts @@ -2138,6 +2138,18 @@ Deno.test(async function inspectAggregateError() { } }); +Deno.test(function inspectWithPrototypePollution() { + const originalExec = RegExp.prototype.exec; + try { + RegExp.prototype.exec = () => { + throw Error(); + }; + Deno.inspect("foo"); + } finally { + RegExp.prototype.exec = originalExec; + } +}); + Deno.test(function inspectorMethods() { console.timeStamp("test"); console.profile("test"); -- cgit v1.2.3