Bug 200758

Summary: for-await-of has bad error message if used in non-async function
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: JavaScriptCoreAssignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, ews-watchlist, joepeck, keith_miller, mark.lam, msaboff, ross.kirsling, saam, tzagallo, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
[PATCH] Proposed Fix
none
[PATCH] Proposed Fix none

Description Joseph Pecoraro 2019-08-14 22:28:49 PDT
for-await-of has bad error message if used in non-async function

----
>>> function f() { for await (let x of []) {} } }
for-await-of can't be used only in async function or async generator..:1
----

It should say that it can only be used an async function or async generator.
Comment 1 Joseph Pecoraro 2019-08-14 22:30:14 PDT
Created attachment 376354 [details]
[PATCH] Proposed Fix
Comment 2 Joseph Pecoraro 2019-08-14 22:32:25 PDT
Created attachment 376355 [details]
[PATCH] Proposed Fix
Comment 3 Ross Kirsling 2019-08-14 22:46:34 PDT
Comment on attachment 376355 [details]
[PATCH] Proposed Fix

Looks good as long as no tests are counting on this output.
Comment 4 WebKit Commit Bot 2019-08-15 01:40:12 PDT
Comment on attachment 376355 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 376355

Committed r248711: <https://trac.webkit.org/changeset/248711>
Comment 5 WebKit Commit Bot 2019-08-15 01:40:13 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Radar WebKit Bug Importer 2019-08-15 01:41:16 PDT
<rdar://problem/54337496>