Hello all,
Today I landed bug 1001090 (assuming it doesn't bounce), implementing ES6
lexical temporal dead zone for function-level `let` declarations, on
mozilla-central. As a refresher on the email I sent on Aug. 13, this is a
backwards-incompatible change.
Everything inside mozilla-central needed to make the tree green on TBPL has
been fixed. However, this is expected to break addons, comm-central, and
possibly B2G code that use `let` (though I was told last time that Gaia does
not use `let`).
If you work with JS that contains `let` bindings, you may start encountering
the following two errors:
1. TypeError: redeclaration of variable foo
To fix, rename the variable or remove the extra `let` if you are
assigning to an already-bound variable.
These are static errors. You may pass your JS through the syntax checker
in the SpiderMonkey shell (-c) to detect them.
2. ReferenceError: can't access let declaration `foo' before initialization
These are hoisted uses and wacky cases like accessing a `let` binding
declared in one switch case in a different case. To fix, don't do those
things please.
These are dynamic errors. You have to execute your JS to detect them.
--
shu
_______________________________________________
dev-platform mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-platform