microsoft / microsoft/TypeScript

Transpilation of iterable spread is incorrect for non-iterable values.

Open
#43,353 4 comments 0 reactions 1 assignee View on GitHub

@rbuckton is already working on this.

Since Mar 23, 2021.

Needs Investigation
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

Bug Report

🔎 Search Terms

transpilation __spreadArray spread iterable

🕗 Version & Regression Information
  • This changed between versions 4.1 and 4.2, but was broken in a different way in 4.1
⏯ Playground Link

https://www.typescriptlang.org/play?target=1&ts=4.2.3#code/MYewdgziA2CmB00QHMAUBteWCMBdAlANxA

💻 Code
console.log([...1]);
🙁 Actual behavior

print []

🙂 Expected behavior

Throw a runtime exception. 1 is not an iterable.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.