Chrome Version: (copy from chrome://version)
OS: (e.g. Win7, OSX 10.9.5, etc...)
What steps will reproduce the problem?
(1) try executing for (var x of 1) { }
(2) now try executing new Set(1,2,3)
What is the expected result?
Two reasonable error messages (e.g. "Uncaught TypeError: 1 is not iterable")
What happens instead?
The for loop produces a reasonable error message, but the Set constructor says:
"Uncaught TypeError: undefined is not a function"
This is reasonably important because it's easy to accidentally omit the list square-brackets when constructing sets (e.g. writing new Set(1,2,3) instead of new Set([1,2,3])) - we should make it super easy to catch and fix this mistake.
Comment 1 by hablich@chromium.org
, Dec 11 2017Components: -Blink>JavaScript Blink>JavaScript>Language
Labels: -Type-Bug Type-Feature
Status: Available (was: Untriaged)