On 9/15/14 4:43 PM, Shu-yu Guo wrote:
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.
Much of the `let` fallout being reported is from variable
redeclarations. For compatibility, perhaps TC39 should reconsider
whether `let` redeclarations are worthy of being static errors.
JS allows you to redeclare vars. Rust allows you to redeclare variables
with `let` (even changing the type!). SpiderMonkey's non-standard JS1.8
allowed you to redeclare variables with `let` (until Shu made it ES6
compatible). Maybe variable redeclarations are not such a big problem
for JS developers.
chris
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform