Can `let`, `static` and `yield` still be used as Identifier?

# Gary Guo (10 years ago)

From the specification I saw yield is being explicitly declared as an possible Identifier in non-strict mode, and there let, static are parsed as identifier first. However, I did not see anyway to distinguish let identifier and let keyword. let=1 is parsed as illegal in traceur, and so does static=1. Is this a bug of traceur or it is intended? It would be incompatible in non-strict mode if this is intended. (And if this is intended, there will be no reason for keep let and static non-reserved-word during lex stage)

# Erik Arvidsson (10 years ago)

This is a bug in Traceur.

# Alex Kocharin (10 years ago)

An HTML attachment was scrubbed... URL: esdiscuss/attachments/20141231/1a0d18c0/attachment-0001

# Rick Waldron (10 years ago)

On Wed Dec 31 2014 at 2:45:57 PM Alex Kocharin <alex at kocharin.ru> wrote:

Firefox does parse let=1 as illegal,

Under what circumstance? All of these function according to the spec:

let = 1;
console.log(let); // 1

var let = 1;
console.log(let); // 1

let let = 1; // SyntaxError

(jsfiddle.net/rwaldron/L5kbtup6)

# Alex Kocharin (10 years ago)

An HTML attachment was scrubbed... URL: esdiscuss/attachments/20150102/3d9474d4/attachment

# Gary Guo (10 years ago)

It seems that in JSFiddle running on Firefox, let declaration is disabled. So this cannot explain.

# Rick Waldron (10 years ago)

I don't know why you'd say that, considering the fiddle works just fine. Open your developer console and you'll see the output. Note that I'm referring to Nightly.

# Gary Guo (10 years ago)

Thanks for your note, I'm not testing it under Nightly. Did you test that the 'let' declaration is working properly in JSFiddle? It may not be enabled in web pages by default if the script doesn't declare to be javascript 1.7.

# Till Schneidereit (10 years ago)

Gary is right: let is disabled for web content in Firefox because our version isn't spec-compatible enough yet. In the shell or chrome code, where it is enabled, our behavior matches traceur's in that we treat the given examples as errors, too.