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

Issue 6519050: Call accessors in the global object prototype when initializing global (Closed)

Created:
9 years, 10 months ago by Mads Ager (chromium)
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Call accessors in the global object prototype when initializing global variables. Make the declaration of global const variables in the presence of callbacks a redeclaration error. Handle const context slot declarations conflicting with a CALLBACK as a redeclaration error. That is, unless it is on a context extension object which is not a real object and therefore conceptually have no accessors in prototype chains. Accessors in prototype chains of context extension objects are explicitly ignored in SetProperty. Committed: http://code.google.com/p/v8/source/detail?r=6841

Patch Set 1 #

Total comments: 2

Patch Set 2 : Address comment. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+87 lines, -33 lines) Patch
M src/runtime.cc View 1 5 chunks +35 lines, -33 lines 0 comments Download
A test/mjsunit/regress/regress-1170.js View 1 chunk +52 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Mads Ager (chromium)
9 years, 10 months ago (2011-02-17 14:46:09 UTC) #1
Kevin Millikin (Chromium)
LGTM. It's sort of ugly that "const" crosscuts so many different parts of the VM. ...
9 years, 10 months ago (2011-02-17 16:01:17 UTC) #2
Mads Ager (chromium)
9 years, 10 months ago (2011-02-17 16:19:21 UTC) #3
Thanks. Yeah, const is not at all nice.

http://codereview.chromium.org/6519050/diff/1/src/runtime.cc
File src/runtime.cc (right):

http://codereview.chromium.org/6519050/diff/1/src/runtime.cc#newcode1085
src/runtime.cc:1085: if (lookup.IsProperty()) {
On 2011/02/17 16:01:17, Kevin Millikin wrote:
> I think you can now write this as:
> 
> if (lookup.IsProperty() &&
>     lookup.type() != INTERCEPTOR &&
>     (lookup.IsReadOnly() || is_const_property)) {
>   const char* type = (lookup.IsReadOnly()) ? "const" : "var";
>   return ThrowRedeclarationError(type, name);
> }
> RETURN_IF_EMPTY_HANDLE(SetProperty(.....));

Done.

Powered by Google App Engine
This is Rietveld 408576698