question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`let default` results in keyword `let` being reported as reserved

See original GitHub issue

The 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:closed
  • Created 7 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
robertrossmanncommented, May 1, 2017

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!

0reactions
kaicataldocommented, Oct 24, 2018

Closing this as it looks like this was fixed upstream.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found