Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Object.observe: include oldValue in change records, (issue 11362115)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
rossb...@chromium.org  
View profile  
 More options Nov 7 2012, 9:05 am
From: rossb...@chromium.org
Date: Wed, 07 Nov 2012 14:05:54 +0000
Local: Wed, Nov 7 2012 9:05 am
Subject: Re: Object.observe: include oldValue in change records, (issue 11362115)

https://chromiumcodereview.appspot.com/11362115/diff/1/src/objects.cc
File src/objects.cc (right):

https://chromiumcodereview.appspot.com/11362115/diff/1/src/objects.cc...
src/objects.cc:2911: case INTERCEPTOR:
On 2012/11/06 14:08:53, adamk wrote:

> Asking for oldValues for interceptors (or in fact even notifying about
changes
> to intercepted properties) is going to be a little surprising (though
possibly
> useful). I didn't notice that the last change handled this. I believe
this means
> that
> Object.observe(document.body.style, ...)
> document.body.style.background = 'something'
> will emit a record that includes the old value of background.  But of
course we
> won't be notified of any style changes that happen outside of script.
Is this
> really what we want?

Changed.

https://chromiumcodereview.appspot.com/11362115/diff/1/src/objects.cc...
src/objects.cc:2913: Object::GetProperty(self, self, lookup, name,
&old_attributes);
On 2012/11/07 10:30:29, adamk wrote:

> On 2012/11/07 10:26:20, rafaelw wrote:
> > Consider using lookup.GetLazyValue()? Note: this would bypass

interceptors.

> Might also bypass access checks, though, which I don't think is

right...

Access checks are already handled further up, I think.

https://chromiumcodereview.appspot.com/11362115/diff/1/src/objects.cc...
src/objects.cc:2913: Object::GetProperty(self, self, lookup, name,
&old_attributes);
On 2012/11/07 10:26:20, rafaelw wrote:

> Consider using lookup.GetLazyValue()? Note: this would bypass

interceptors.

Done, here and elsewhere. With a little tweak to that function
(returning the hole in the default case), it also simplified some of the
code quite a bit.

https://chromiumcodereview.appspot.com/11362115/diff/1/src/objects.cc...
src/objects.cc:2971: result = ConvertDescriptorToField(*name, *value,
attributes);
On 2012/11/06 17:35:47, Toon Verwaest wrote:

> self->

Done.

https://chromiumcodereview.appspot.com/11362115/diff/1/src/objects.cc...
src/objects.cc:2984: result = ConvertTransitionToMapTransition(
On 2012/11/06 17:35:47, Toon Verwaest wrote:

> self->

Done.

https://chromiumcodereview.appspot.com/11362115/diff/1/src/objects.cc...
src/objects.cc:3002: } else if (new_attributes != old_attributes) {
On 2012/11/07 10:26:20, rafaelw wrote:

> out of curiosity: how can it happen that new_attributes !=

old_attributes?

Right, I think it cannot in this case. Removed.

https://chromiumcodereview.appspot.com/11362115/diff/1/src/objects.cc...
src/objects.cc:3009: self->EnqueueChangeRecord("updated", name,
old_value);
On 2012/11/06 17:35:47, Toon Verwaest wrote:

> Wouldn't it be less error-prone to make EnqueueChangeRecord a static
method that
> takes a handle in for the receiver?

Probably, but the same is true for quite a few other methods. In the
face of that, I favour consistency, at least for the time being.

https://chromiumcodereview.appspot.com/11362115/diff/1/src/objects.cc...
src/objects.cc:3091: Object::GetProperty(self, self, &lookup, name,
&old_attributes);
On 2012/11/07 10:26:20, rafaelw wrote:

> ditto: GetLazyValue()

Done.

https://chromiumcodereview.appspot.com/11362115/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.