Skip to content

Commit 2484363

Browse files
committed
Do not reassign Symbol.asyncIterator
1 parent e59797c commit 2484363

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

‎test/base/typescript-tests.ts‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1573,8 +1573,9 @@ test("it should support asyncAction as decorator (ts)", async () => {
15731573
})
15741574

15751575
test("flow support async generators", async () => {
1576-
;(Symbol as any).asyncIterator =
1577-
(Symbol as any).asyncIterator || Symbol.for("Symbol.asyncIterator")
1576+
if (!(Symbol as any).asyncIterator) {
1577+
(Symbol as any).asyncIterator = Symbol.for("Symbol.asyncIterator")
1578+
}
15781579

15791580
async function* someNumbers() {
15801581
await Promise.resolve()
@@ -1600,8 +1601,9 @@ test("flow support async generators", async () => {
16001601
})
16011602

16021603
test("flow support throwing async generators", async () => {
1603-
;(Symbol as any).asyncIterator =
1604-
(Symbol as any).asyncIterator || Symbol.for("Symbol.asyncIterator")
1604+
if (!(Symbol as any).asyncIterator) {
1605+
(Symbol as any).asyncIterator = Symbol.for("Symbol.asyncIterator")
1606+
}
16051607

16061608
async function* someNumbers() {
16071609
await Promise.resolve()

0 commit comments

Comments
 (0)