Reviewers: Michael Starzinger,
Description:
Implement ES5 erratum: all global declerations shadow inherited properties.
I also discovered that our treatment of const declarations is inconsistent
when inside a global eval under 'with' (i.e., when created by
DeclareContextSlots). That is,
var x;
eval("const x = 9")
and
var x;
eval("with({}) const x = 9")
differ (the former assigns 9, the latter throws). This appears to be an
oversight from earlier changes to our const semantics (the latter shouldn't
throw either). Fixing this is a separate issue, though (and one that doesn't
seem quite worthwhile).
[email protected]
BUG=v8:1991,80591
TEST=
Please review this at https://chromiumcodereview.appspot.com/10067010/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/contexts.h
M src/objects.cc
M src/parser.cc
M src/runtime.cc
M test/cctest/test-api.cc
M test/cctest/test-decls.cc
M test/mjsunit/declare-locally.js
M test/mjsunit/mjsunit.js
M test/mjsunit/regress/regress-1119.js
M test/mjsunit/regress/regress-115452.js
M test/mjsunit/regress/regress-1170.js
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev