Bug 241089 - Misleading error message for "for(i of 123)"
Summary: Misleading error message for "for(i of 123)"
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: Safari 15
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-05-29 20:43 PDT by 845043157
Modified: 2022-06-05 20:44 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description 845043157 2022-05-29 20:43:19 PDT
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.
Comment 1 Radar WebKit Bug Importer 2022-06-05 20:44:12 PDT
<rdar://problem/94416161>