| Summary: | [JSC] `let [` sequence cannot appear in ExpressionStatement context | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Yusuke Suzuki <ysuzuki> | ||||
| Component: | New Bugs | Assignee: | Yusuke Suzuki <ysuzuki> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | ews-watchlist, keith_miller, mark.lam, msaboff, ross.kirsling, saam, tzagallo, webkit-bug-importer | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | WebKit Nightly Build | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=262456 | ||||||
| Attachments: |
|
||||||
|
Description
Yusuke Suzuki
2020-08-29 02:27:12 PDT
Created attachment 407538 [details]
Patch
Comment on attachment 407538 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=407538&action=review r=me. I'm shocked at how simple this patch is. > Source/JavaScriptCore/parser/Parser.cpp:1964 > + failIfTrue(match(OPENBRACKET), "\"let [\" cannot appear at the beginning of expression statement context"); This is fine as an explanation for a spec-aware individual, but I don't think it's clear enough as a user-facing error message. How about something like "cannot appear in a single-line control flow body"? Comment on attachment 407538 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=407538&action=review >> Source/JavaScriptCore/parser/Parser.cpp:1964 >> + failIfTrue(match(OPENBRACKET), "\"let [\" cannot appear at the beginning of expression statement context"); > > This is fine as an explanation for a spec-aware individual, but I don't think it's clear enough as a user-facing error message. > How about something like "cannot appear in a single-line control flow body"? Yeah, I've changed this to `Cannot use lexical declaration in single-statement context.` Committed r266327: <https://trac.webkit.org/changeset/266327> |