archives

« Bugzilla Issues Index

#3148 — need to better define "can be statically determined"


12.14.1, 1st case 3rd bullet: "can be statically determined" is far too vague here. Consider "const x = 0; with ({__proto__: null}) x = 1;" -- it is possible (and in this case even fairly easy) to statically determine the condition. Or "const x = 0; { eval(""); x = 1}". But those are clearly not cases that you want to require an error for. The spec needs to be more specific, probably by explicitly ruling out cases with intervening object environments, or scopes with sloppy eval.
12.14.1, 2nd case 1st bullet: dito
12.14.5.1, 3rd case, 3rd bullet: dito

split from Bug 2982


Note that this includes import bindings as well as const bindings. There should probably at least be informative text clarifying this in the spec, even if "statically determined" isn't formalized more precisely.

Dave


fixed in rev29 editor's draft

statically determined language and requirement removed as per TC39 discussion https://github.com/tc39/tc39-notes/blob/master/es6/2014-11/nov-18.md#43-assignment-to-a-const-static-error


fixed in rev29