Title: for-of does not work with some DOM collections when target is ES6 · Issue #2695 · microsoft/TypeScript · GitHub
Open Graph Title: for-of does not work with some DOM collections when target is ES6 · Issue #2695 · microsoft/TypeScript
X Title: for-of does not work with some DOM collections when target is ES6 · Issue #2695 · microsoft/TypeScript
Description: Update: This issue is now only for the following collections: MediaList StyleSheetList CSSRuleList Originally it was about NodeList as well, but that was fixed (along with DOMTokenList) in #3393 Original: var paragraphs = document.queryS...
Open Graph Description: Update: This issue is now only for the following collections: MediaList StyleSheetList CSSRuleList Originally it was about NodeList as well, but that was fixed (along with DOMTokenList) in #3393 Or...
X Description: Update: This issue is now only for the following collections: MediaList StyleSheetList CSSRuleList Originally it was about NodeList as well, but that was fixed (along with DOMTokenList) in #3393 Or...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/2695
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"for-of does not work with some DOM collections when target is ES6","articleBody":"Update: This issue is now only for the following collections:\n- MediaList\n- StyleSheetList\n- CSSRuleList\n\nOriginally it was about NodeList as well, but that was fixed (along with DOMTokenList) in #3393\n\n---\n\nOriginal:\n\n``` typescript\nvar paragraphs = document.querySelectorAll(\"p\");\nfor (let p of paragraphs) {\n console.log(p);\n}\n```\n\n```\nfoo.ts(2,15): error TS2488: The right-hand side of a 'for...of' statement must have a '[Symbol.iterator]()' method that returns an iterator.\n```\n\nSeems it just needs an update to lib.es6.d.ts to add the `[Symbol.iterator()]` to all the collections that have an indexer and length property. ~~The ones I found that have it in Nightly are below. The rest were either IE-only or didn't exist.~~ Removed my list since it seems FF has more than the specs allow. See https://github.com/zloirock/core-js/issues/137#issuecomment-159531781 for a more accurate list.\n","author":{"url":"https://github.com/Arnavion","@type":"Person","name":"Arnavion"},"datePublished":"2015-04-09T22:19:28.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":42},"url":"https://github.com/2695/TypeScript/issues/2695"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:bda75cec-ddc6-4109-d01c-03dea3050596 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 93A4:194C11:65C25:888E8:6A62668E |
| html-safe-nonce | 8b31de8ad7839edfd8001c075baeb828922fa431bb1124a83d3248f83d8a60b1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5M0E0OjE5NEMxMTo2NUMyNTo4ODhFODo2QTYyNjY4RSIsInZpc2l0b3JfaWQiOiI3OTQ1Nzc0NDc1MzEyNzg1MDM4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | b90374cf5578acabc3dfa0a1fa74472a23467c60e75751201936b4400023cfb2 |
| hovercard-subject-tag | issue:67462688 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/2695/issue_layout |
| twitter:image | https://opengraph.githubassets.com/86a47da331fec7edec1ef976e5dba8e4ab71442a3ae3a444d90436da771d7f95/microsoft/TypeScript/issues/2695 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/86a47da331fec7edec1ef976e5dba8e4ab71442a3ae3a444d90436da771d7f95/microsoft/TypeScript/issues/2695 |
| og:image:alt | Update: This issue is now only for the following collections: MediaList StyleSheetList CSSRuleList Originally it was about NodeList as well, but that was fixed (along with DOMTokenList) in #3393 Or... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Arnavion |
| hostname | github.com |
| expected-hostname | github.com |
| None | 194bddaed53c0eb07047629c520853f4208e77a17ff57428346485cc202e39f2 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c2862cf2db52f0c7f6cba3de21ffeeafe7c5456e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width