`let default` results in keyword `let` being reported as reserved
See original GitHub issueThe following code:
espree.parse('let default = true', { ecmaVersion: 6, sourceType: 'module' })
Results in the following error: SyntaxError: The keyword 'let' is reserved
Expected behaviour: I would have expected to see the default
being reported as reserved keyword, not let
.
When sourceType: 'script'
or when I use const
or var
instead of let
, the error seems to match my expectations by reporting the following: SyntaxError: Unexpected token default
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
let - JavaScript - MDN Web Docs
The let declaration declares a block-scoped local variable, optionally initializing it to a value.
Read more >let is a reserved identifier require.js:52:2" appears when ...
First, in strict mode a short list of identifiers become reserved keywords. These words are implements, interface, let, package, private, protected, public, ...
Read more >Reserved keywords in ES6 with example usage - Medium
First, let's see what happens when reserved keywords are used inappropriately: Invalid usage of reserved keywords. Function, switch and for are all reserved...
Read more >JavaScript Let - W3Schools
The let keyword was introduced in ES6 (2015). Variables defined with let cannot be Redeclared. Variables defined with let must be Declared before...
Read more >Robot Framework User Guide
Provides ability to create reusable higher-level keywords from the existing keywords. Provides easy-to-read result reports and logs in HTML format. Is platform ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Opened a new issue in Acorn repo: https://github.com/ternjs/acorn/issues/544 🎉
Feel free to close this unless you would like to keep track of this. Thanks!
Closing this as it looks like this was fixed upstream.