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

Issue 46030: Implementing __defineSetter__ and __defineGetter__ with an array index as arg... (Closed)

Created:
11 years, 9 months ago by olehougaard
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Implementing __defineSetter__ and __defineGetter__ with an array index as argument as described in issue 242. For performance reasons, the change is not applied to arrays. This conforms to the behavior of Safari. Committed: http://code.google.com/p/v8/source/detail?r=1507

Patch Set 1 #

Total comments: 9
Unified diffs Side-by-side diffs Delta from patch set Stats (+336 lines, -75 lines) Patch
M src/objects.h View 7 chunks +14 lines, -4 lines 4 comments Download
M src/objects.cc View 17 chunks +220 lines, -71 lines 4 comments Download
M src/objects-inl.h View 1 chunk +7 lines, -0 lines 0 comments Download
A test/mjsunit/indexed-accessors.js View 1 chunk +95 lines, -0 lines 1 comment Download

Messages

Total messages: 3 (0 generated)
olehougaard
11 years, 9 months ago (2009-03-13 09:45:49 UTC) #1
Mads Ager (chromium)
LGTM http://codereview.chromium.org/46030/diff/1/2 File src/objects.cc (right): http://codereview.chromium.org/46030/diff/1/2#newcode2602 Line 2602: // Update the array length if this ...
11 years, 9 months ago (2009-03-13 10:27:14 UTC) #2
olehougaard
11 years, 9 months ago (2009-03-13 11:39:46 UTC) #3
http://codereview.chromium.org/46030/diff/1/2
File src/objects.cc (right):

http://codereview.chromium.org/46030/diff/1/2#newcode2602
Line 2602: // Update the array length if this JSObject is an array.
On 2009/03/13 10:27:14, Mads Ager wrote:
> Since we do not do this for arrays, we can remove this code.

Fixed.

http://codereview.chromium.org/46030/diff/1/2#newcode5356
Line 5356: if (structure->get(kSetterIndex)->IsJSFunction()) {
On 2009/03/13 10:27:14, Mads Ager wrote:
> I believe that we throw exceptions when setting named properties that have
only
> a getter.  Should we do the same here instead of falling through?

That's true. I've fixed it and added a test for it.

http://codereview.chromium.org/46030/diff/1/3
File src/objects.h (right):

http://codereview.chromium.org/46030/diff/1/3#newcode1998
Line 1998: // Set and existing entry or add a new one if needed.
On 2009/03/13 10:27:14, Mads Ager wrote:
> I know this is not your comment, but could you fix:
> 
> and -> an

Fixed.

http://codereview.chromium.org/46030/diff/1/3#newcode2028
Line 2028: // kRequiresSlowElementsLimit or set_requires_slow_elements() has
been called.
On 2009/03/13 10:27:14, Mads Ager wrote:
> Maybe state the real reason here: if a getter or setter with a number key has
> been defined?

Fixed.

Powered by Google App Engine
This is Rietveld 408576698