We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeScript Version: nightly (2.2.0-dev.20161118)
Chrome Version: Stable 54.0.2840.99 (Official Build) m (64-bit) (Revision 7eca4ce1e662f12cadaf96c30cd2335fd03e7140-refs/branch-heads/2840@{#830})
TypeScript Code: (relevant portion)
for (var param of iterator) {
Transpiled ES5 JavaScript (relevant portion):
for (... ; _i < iterator_1.length; _i++) { ^^^^^^^^^^^^^^^^^ length is undefined
Screenshot of Transpiled ES5 Code:
Expected behavior: Using for (var x of iterator) { ... } should be transpiled correctly.
for (var x of iterator) { ... }
Actual behavior: The iterator loop is transpiled to use the length property which appears to be undefined for the iterator.
length
Reproducible Project
For some reason, GitHub isn't allowing me to upload a .zip file, so here's a Google Drive link to the project ZIP: https://goo.gl/xvbwHu.
.zip
The text was updated successfully, but these errors were encountered:
That would have been a compile time error.
Dupe of #11209 and others...
Sorry, something went wrong.
Makes sense, I also see this at the bottom here: https://www.typescriptlang.org/docs/handbook/iterators-and-generators.html
Closing since this is a documented issue and there are other open issues about this.
No branches or pull requests
TypeScript Version: nightly (2.2.0-dev.20161118)
Chrome Version: Stable 54.0.2840.99 (Official Build) m (64-bit) (Revision 7eca4ce1e662f12cadaf96c30cd2335fd03e7140-refs/branch-heads/2840@{#830})
TypeScript Code: (relevant portion)
Transpiled ES5 JavaScript (relevant portion):
Screenshot of Transpiled ES5 Code:
Expected behavior:
Using
for (var x of iterator) { ... }
should be transpiled correctly.Actual behavior:
The iterator loop is transpiled to use the
length
property which appears to be undefined for the iterator.Reproducible Project
For some reason, GitHub isn't allowing me to upload a
.zip
file, so here's a Google Drive link to the project ZIP: https://goo.gl/xvbwHu.The text was updated successfully, but these errors were encountered: