Bug 200758 - for-await-of has bad error message if used in non-async function
Summary: for-await-of has bad error message if used in non-async function
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-08-14 22:28 PDT by Joseph Pecoraro
Modified: 2019-08-15 01:41 PDT (History)
11 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (1.35 KB, patch)
2019-08-14 22:30 PDT, Joseph Pecoraro
no flags Details | Formatted Diff | Diff
[PATCH] Proposed Fix (1.34 KB, patch)
2019-08-14 22:32 PDT, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>