Reviewers: fschneider,
Message:
PTAL.
Description:
Statically check for assignments to const in harmony mode.
The ES.next draft rev 4 in section 11.13 reads:
It is a Syntax Error if the AssignmentExpression is contained in extended
code
and the LeftHandSideExpression is an Identifier that does not statically
resolve
to a declarative environment record binding or if the resolved binding is an
immutable binding.
This CL adds corresponding static checks for the immutable binding case.
TEST=mjsunit/harmony/block-const-assign
Please review this at http://codereview.chromium.org/8688007/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/ast.h
M src/ast.cc
M src/compiler.cc
M src/messages.js
M src/parser.h
M src/parser.cc
M src/scopes.h
M src/scopes.cc
A test/mjsunit/harmony/block-const-assign.js
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev