On 7/23/17 12:30 AM, Alexander Craggs wrote:
Say we create such versioning, it would allow us to improve the language
so much more than we're currently able to, we'd no longer have to stick
with useless error messages for forgetting `async`:
```js
< function u() { let x = await "hi" }
Uncaught SyntaxError: Unexpected string
In Chrome, that's what you get. In Firefox, you get:
SyntaxError: await is only valid in async functions
which is about what you're asking for. In Safari, you get:
SyntaxError: Unexpected string literal "hi". Expected ';' after
variable declaration.
which is a moderately more informative version of the Chrome error message.
In any case, it's quite clear that a JS engine _can_ report the "right"
error here; Firefox does so. Engines that don't do that should just
start doing it, and this should not involve any spec changes.
-Boris
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss