summaryrefslogtreecommitdiff
path: root/cli/tests/unit/flash_test.ts
diff options
context:
space:
mode:
authorKenta Moriuchi <moriken@kimamass.com>2023-03-13 19:24:31 +0900
committerGitHub <noreply@github.com>2023-03-13 19:24:31 +0900
commite5673f5ed85774831234fe70290d5802bbd47c15 (patch)
tree59a8deb3e81bc596ec73afcaae01de9a1cb1e845 /cli/tests/unit/flash_test.ts
parentbcb6ee9d0864f490f6da47cbe2593310b21333ff (diff)
fix(core): `SafePromiseAll` to be unaffected by `Array#@@iterator` (#17542)
Diffstat (limited to 'cli/tests/unit/flash_test.ts')
-rw-r--r--cli/tests/unit/flash_test.ts6
1 files changed, 4 insertions, 2 deletions
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;
}
},
);