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

Issue 11358234: Object.observe: Handle oldValue for elements with accessors properly. (Closed)

Created:
8 years, 1 month ago by rossberg
Modified:
8 years, 1 month ago
CC:
v8-dev, adamk, rafaelw
Visibility:
Public.

Description

Object.observe: Handle oldValue for elements with accessors properly. Extended ElementAccessor interface to allow querying PropertyType and AccessorPair. Also added respective functionality to JSObject. R=mstarzinger@chromium.org BUG= Committed: https://code.google.com/p/v8/source/detail?r=12967

Patch Set 1 #

Total comments: 4

Patch Set 2 : Addressed comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+194 lines, -19 lines) Patch
M src/elements.h View 1 chunk +22 lines, -0 lines 0 comments Download
M src/elements.cc View 1 4 chunks +112 lines, -1 line 0 comments Download
M src/objects.h View 2 chunks +7 lines, -2 lines 0 comments Download
M src/objects.cc View 5 chunks +46 lines, -10 lines 0 comments Download
M src/runtime.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M test/mjsunit/harmony/object-observe.js View 3 chunks +5 lines, -4 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
rossberg
8 years, 1 month ago (2012-11-14 16:10:42 UTC) #1
Michael Starzinger
LGTM with two comments. https://codereview.chromium.org/11358234/diff/1/src/elements.cc File src/elements.cc (right): https://codereview.chromium.org/11358234/diff/1/src/elements.cc#newcode1551 src/elements.cc:1551: return AccessorPair::cast(backing_store->ValueAt(entry)); This could potentially ...
8 years, 1 month ago (2012-11-14 17:30:39 UTC) #2
Sven Panne
https://codereview.chromium.org/11358234/diff/1/src/elements.cc File src/elements.cc (right): https://codereview.chromium.org/11358234/diff/1/src/elements.cc#newcode1551 src/elements.cc:1551: return AccessorPair::cast(backing_store->ValueAt(entry)); On 2012/11/14 17:30:39, Michael Starzinger wrote: > ...
8 years, 1 month ago (2012-11-15 06:36:32 UTC) #3
rossberg
8 years, 1 month ago (2012-11-15 11:25:42 UTC) #4
https://codereview.chromium.org/11358234/diff/1/src/elements.cc
File src/elements.cc (right):

https://codereview.chromium.org/11358234/diff/1/src/elements.cc#newcode1551
src/elements.cc:1551: return AccessorPair::cast(backing_store->ValueAt(entry));
On 2012/11/15 06:36:32, Sven Panne wrote:
> On 2012/11/14 17:30:39, Michael Starzinger wrote:
> > This could potentially also be a Foreign callback or a AccessorInfo
callback.
> I
> > am unsure if that ever happens in any of our embedders, so we could just add
a
> > CHECK (on top of the implicit assertion) here that the value we get out
> actually
> > is a AccessorPair. WDYT?
> 
> The Foreign case is completely under our control and (very probably) doesn't
> matter here, but the unhandled AccessorInfo case really makes me nervous: If I
> understand things correctly, this would change our external API with unknown
> consequences. I would very much prefer avoiding this. If there is really,
really
> no way around this, the restriction (which one exactly?) should be documented
in
> a very visible way in our external header.

That was an oversight. Added IsAccessorPair condition, returning NULL otherwise
(analogous to JSObject::GetLocalPropertyAccessorPair).

Powered by Google App Engine
This is Rietveld 408576698