summaryrefslogtreecommitdiff
path: root/cli/tests/unit/command_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/unit/command_test.ts')
-rw-r--r--cli/tests/unit/command_test.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/cli/tests/unit/command_test.ts b/cli/tests/unit/command_test.ts
index b9fa8295b..0763a7ac6 100644
--- a/cli/tests/unit/command_test.ts
+++ b/cli/tests/unit/command_test.ts
@@ -851,10 +851,11 @@ Deno.test(
Deno.test(
{ permissions: { read: true, run: true } },
- async function commandWithPromisePrototypeThenOverride() {
+ async function commandWithPrototypePollution() {
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();
};
await new Deno.Command(Deno.execPath(), {
@@ -862,6 +863,7 @@ Deno.test(
}).output();
} finally {
Promise.prototype.then = originalThen;
+ Array.prototype[Symbol.iterator] = originalSymbolIterator;
}
},
);