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

Issue 6658037: Change __defineGetter__ and __defineSetter__ to respect non-configurable.... (Closed)

Created:
9 years, 9 months ago by Rico
Modified:
9 years, 6 months ago
Reviewers:
Lasse Reichstein
CC:
v8-dev
Visibility:
Public.

Description

Change __defineGetter__ and __defineSetter__ to respect non-configurable. This makes us compatible with firefox. Earlier on we were somehow compatible with safari - which will allow defining a getter even when an existing getter is present and non-configurable. We would, however, in addition to overwriting the getter also change configurable to true. The approach used by firefox seems much more sound, i.e., why should it be possible to use __defineGetter__ or __defineSetter__ to overwrite a non-configurable getter or setter respectively. I will file a bug on the webkit bugtracker. Committed: http://code.google.com/p/v8/source/detail?r=7143

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+59 lines, -7 lines) Patch
M src/v8natives.js View 5 chunks +9 lines, -4 lines 6 comments Download
M test/mjsunit/accessors-on-global-object.js View 3 chunks +3 lines, -3 lines 0 comments Download
A test/mjsunit/regress/regress-1240.js View 1 1 chunk +43 lines, -0 lines 0 comments Download
M test/mozilla/mozilla.status View 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Rico
9 years, 9 months ago (2011-03-10 16:57:45 UTC) #1
Rico
Forgot to svn add the regression test - added now
9 years, 9 months ago (2011-03-11 07:01:44 UTC) #2
Lasse Reichstein
LGTM http://codereview.chromium.org/6658037/diff/2001/src/v8natives.js File src/v8natives.js (right): http://codereview.chromium.org/6658037/diff/2001/src/v8natives.js#newcode255 src/v8natives.js:255: desc = ToPropertyDescriptor(desc); Why not var desc = ...
9 years, 9 months ago (2011-03-11 07:52:35 UTC) #3
Rico
9 years, 9 months ago (2011-03-11 08:05:48 UTC) #4
http://codereview.chromium.org/6658037/diff/2001/src/v8natives.js
File src/v8natives.js (right):

http://codereview.chromium.org/6658037/diff/2001/src/v8natives.js#newcode255
src/v8natives.js:255: desc = ToPropertyDescriptor(desc);
On 2011/03/11 07:52:35, Lasse Reichstein wrote:
> Why not
>  var desc = new PropertyDescriptor();
>  desc.setEnumerable(true);
>  ... etc.
> 
> Or at least make it 
>   var desc = { ..., __proto__:null };
> to ensure against inherited values.

Done.

http://codereview.chromium.org/6658037/diff/2001/src/v8natives.js#newcode276
src/v8natives.js:276: var desc = { set: fun, enumerable: true, configurable:
true };
On 2011/03/11 07:52:35, Lasse Reichstein wrote:
> Ditto.

Done.

http://codereview.chromium.org/6658037/diff/2001/src/v8natives.js#newcode401
src/v8natives.js:401: //PropertyDescriptor.prototype.__proto__ = null;
On 2011/03/11 07:52:35, Lasse Reichstein wrote:
> Uncomment this! :)
> And add:
> PropertyDescriptor.prototype.toString = function() { return "[object
> PropertyDescriptor]"; };
Ups, sorry, and done

Powered by Google App Engine
This is Rietveld 408576698