Microsoft/TypeScript

Parse error when using `in` nested in a `for` initializer

Open

#59,236 建立於 2024年7月11日

在 GitHub 查看
 (7 留言) (0 反應) (0 負責人)TypeScript (6,726 fork)batch import
BugDomain: ParserHelp Wanted

倉庫指標

Star
 (48,455 star)
PR 合併指標
 (平均合併 6天 17小時) (30 天內合併 9 個 PR)

描述

🔎 Search Terms

in for in init syntax error

🕗 Version & Regression Information

  • This is the behavior in every version I tried

⏯ Playground Link

https://www.typescriptlang.org/play/?ts=5.5.3#code/GYewTgBAFAbghpOEC8EDaAjCBLAdhAYwF0BuEgShKA

💻 Code

for (var a = [b in c];;);

🙁 Actual behavior

It says "',' expected." at the in

🙂 Expected behavior

It should parse it properly

Additional information about the issue

No response

貢獻者指南