Bug 241089
| Summary: | Misleading error message for "for(i of 123)" | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | 845043157 |
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | saam, webkit-bug-importer, ysuzuki |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari 15 | ||
| Hardware: | PC | ||
| OS: | Linux | ||
845043157
Steps to reproduce:
Run the program:
for(i of 123)
Actual results:
TypeError:undefined is not a function (near ‘...i of 123’).
Expected results:
TypeError:Spread syntax requires ...iterable[Symbol.iterator] to be a function.(run new Object(...123);)
or TypeError:123 is not iterable(V8,SpiderMonkey).
The error message confuses me where is undefined and why it is wrong.I think the following error message may be better.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/94416161>