From e5673f5ed85774831234fe70290d5802bbd47c15 Mon Sep 17 00:00:00 2001 From: Kenta Moriuchi Date: Mon, 13 Mar 2023 19:24:31 +0900 Subject: fix(core): `SafePromiseAll` to be unaffected by `Array#@@iterator` (#17542) --- cli/tests/unit/flash_test.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'cli/tests/unit/flash_test.ts') diff --git a/cli/tests/unit/flash_test.ts b/cli/tests/unit/flash_test.ts index ebee7a024..d32e0a54f 100644 --- a/cli/tests/unit/flash_test.ts +++ b/cli/tests/unit/flash_test.ts @@ -2272,10 +2272,11 @@ Deno.test( Deno.test( { permissions: { net: true } }, - async function serveWithPromisePrototypeThenOverride() { + async function serveWithPrototypePollution() { const originalThen = Promise.prototype.then; + const originalSymbolIterator = Array.prototype[Symbol.iterator]; try { - Promise.prototype.then = () => { + Promise.prototype.then = Array.prototype[Symbol.iterator] = () => { throw new Error(); }; const ac = new AbortController(); @@ -2292,6 +2293,7 @@ Deno.test( await server; } finally { Promise.prototype.then = originalThen; + Array.prototype[Symbol.iterator] = originalSymbolIterator; } }, ); -- cgit v1.2.3