Bug 148098
| Summary: | We need a better error message for the use let/const/class in a Statement and not a StatementListItem | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Saam Barati <saam> |
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | Normal | CC: | basile_clement, bburg, benjamin, fpizlo, ggaren, littledan, mark.lam, mmirman, msaboff, oliver, ticaiolima, ysuzuki |
| Priority: | P2 | ||
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Saam Barati
i.e,
if (c)
let/const/class F;
while (c)
let/const/class F;
should have a better syntax error message.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Daniel Ehrenberg
Whenever you're editing this code, there's a case in this area that I believe should be allowed, but seems to throw a syntax error:
```
if (true) let: x()
```
or
```
with ({}) let: y()
```
When I run that in JSC, I get
SyntaxError: Unexpected token ':'. Parse error.
whereas in V8, ChakraCore and SpiderMonkey, let is permitted as a label.
Caio Lima
(In reply to comment #1)
> Whenever you're editing this code, there's a case in this area that I
> believe should be allowed, but seems to throw a syntax error:
>
> ```
> if (true) let: x()
> ```
>
> or
>
> ```
> with ({}) let: y()
> ```
>
> When I run that in JSC, I get
>
> SyntaxError: Unexpected token ':'. Parse error.
>
> whereas in V8, ChakraCore and SpiderMonkey, let is permitted as a label.
Daniel, we are solving this bug in https://bugs.webkit.org/show_bug.cgi?id=168684
Thank you for your report.
Yusuke Suzuki
*** This bug has been marked as a duplicate of bug 168684 ***