Microsoft/TypeScript

Should not allow `import.defer?.('x')`

開放

#63,679 建立於 2026年7月25日

 (2 則留言) (0 個反應) (0 位負責人)TypeScript (13,395 個分叉)batch import
BugDomain: ParserHelp Wanted

倉庫指標

星標
 (108,860 顆星)
PR 合併指標
 (平均合併 6天 17小時) (30 天內合併 9 個 PR)

描述

🔎 Search Terms

"import defer"

🕗 Version & Regression Information

  • This changed between versions ______ and _______
  • This changed in commit or PR _______
  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about 6.0.3_____
  • I was unable to test this on prior versions because _______

⏯ Playground Link

https://www.typescriptlang.org/play/?moduleResolution=99&target=99&ssl=3&ssc=40&pln=2&pc=1#code/JYWwDg9gTgLgBPAZlCI4HIYE8wFMDOAxlMGDOgNwBQVhEAdvvGHALxyiSwB0AJrolxQA-NwAUmHAWKlyASgpA

💻 Code

import.defer?.('x');

🙁 Actual behavior

No errors.

🙂 Expected behavior

Should not allow it as an optional call.

Additional information about the issue

Parsers like Oxc, Yuku, SWC, Babel all reject it. I didn't read the spec, but unless they are wrong.

貢獻者指南