Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Issue 10067010: Implement ES5 erratum: global declarations shadow inherited properties. (Closed)

Created:
8 years, 8 months ago by rossberg
Modified:
8 years, 8 months ago
Reviewers:
Michael Starzinger
CC:
v8-dev
Visibility:
Public.

Description

Implement ES5 erratum: global declarations 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). R=mstarzinger@chromium.org BUG=v8:1991, 80591 TEST= Committed: https://code.google.com/p/v8/source/detail?r=11333

Patch Set 1 #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+99 lines, -82 lines) Patch
M src/contexts.h View 1 chunk +1 line, -1 line 0 comments Download
M src/objects.cc View 2 chunks +0 lines, -2 lines 0 comments Download
M src/parser.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/runtime.cc View 5 chunks +34 lines, -38 lines 4 comments Download
M test/cctest/test-api.cc View 1 chunk +2 lines, -2 lines 2 comments Download
M test/cctest/test-decls.cc View 4 chunks +7 lines, -7 lines 0 comments Download
M test/mjsunit/declare-locally.js View 1 chunk +2 lines, -2 lines 0 comments Download
M test/mjsunit/mjsunit.js View 1 chunk +1 line, -1 line 0 comments Download
M test/mjsunit/regress/regress-1119.js View 1 chunk +2 lines, -2 lines 0 comments Download
M test/mjsunit/regress/regress-115452.js View 1 chunk +6 lines, -7 lines 0 comments Download
M test/mjsunit/regress/regress-1170.js View 1 chunk +43 lines, -19 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
rossberg
8 years, 8 months ago (2012-04-12 14:55:18 UTC) #1
Michael Starzinger
LGTM (just a few nits). https://chromiumcodereview.appspot.com/10067010/diff/1/src/runtime.cc File src/runtime.cc (right): https://chromiumcodereview.appspot.com/10067010/diff/1/src/runtime.cc#newcode1344 src/runtime.cc:1344: // If the local ...
8 years, 8 months ago (2012-04-16 11:32:30 UTC) #2
rossberg
8 years, 8 months ago (2012-04-16 13:15:44 UTC) #3
https://chromiumcodereview.appspot.com/10067010/diff/1/src/runtime.cc
File src/runtime.cc (right):

https://chromiumcodereview.appspot.com/10067010/diff/1/src/runtime.cc#newcode...
src/runtime.cc:1344: // If the local property exists, check that we can either
reconfigure it
On 2012/04/16 11:32:30, Michael Starzinger wrote:
> This sentences is missing the "or" part of "either ... or" I think.

Done.

https://chromiumcodereview.appspot.com/10067010/diff/1/src/runtime.cc#newcode...
src/runtime.cc:1496: /*ERRATUM: no longer need to traverse the prototype
chain?*/
On 2012/04/16 11:32:30, Michael Starzinger wrote:
> This looks like a leftover, should that be a TODO?

Done.

https://chromiumcodereview.appspot.com/10067010/diff/1/test/cctest/test-api.cc
File test/cctest/test-api.cc (right):

https://chromiumcodereview.appspot.com/10067010/diff/1/test/cctest/test-api.c...
test/cctest/test-api.cc:12433: // value does not shadow an existing property in
the prototype chain.
On 2012/04/16 11:32:30, Michael Starzinger wrote:
> The whole comment no longer applies.

Done.

Powered by Google App Engine
This is Rietveld 408576698