Status: Untriaged
Owner: ----
New issue 4144 by [email protected]: const is allowed in for-of loops with
multiple iterations
https://code.google.com/p/v8/issues/detail?id=4144
Version: 8712d032e781e20b3c16aae877951b7929aadaad
OS: Ubuntu 14.04.2 LTS
Architecture: x64
What steps will reproduce the problem?
$ rlwrap ./out/x64.release/d8
V8 version 4.5.0 (candidate) [console: dumb]
d8> (function() { "use strict"; for(const i of [1, 2, 3]) { print(i); }
})();
1
2
3
undefined
What is the expected output?
TypeError: Assignment to constant variable.
What do you see instead?
no Error
https://codereview.chromium.org/977543002/ fixed this for `for` loops, but
not `for-of` loops as far as I can tell.
If this is allowed by some quirk of the ES6 spec, please close, sorry.
The tests in test/mjsunit/es6/block-const-assign.js suggested to me that it
is *not* allowed because they don't test for more than one iteration with
`const`.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.