My favorites | Sign in
v8
Project Home Downloads Wiki Issues Source Code Search
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 618: Simple constructors does not handle adding setters
10 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  verwa...@chromium.org
Closed:  Jun 2013
Cc:  mstarzinger@chromium.org, rossb...@chromium.org
ES5


Sign in to add a comment
 
Project Member Reported by sgjesse@chromium.org, Feb 18, 2010
A simple constructor is a function where there are only statements of the 
form this.x = ... where ... is either a constant or an argument, e.g.

function C() {
  this.x = 23;
}

If a setter is added to the prototype chain of a simple constructor setting 
one of the properties assigned in the constructor then this setter is 
ignored when constructing new objects from the constructor.

This only happens if the setter is added _after_ an instance has been 
created, e.g.

new C().x;  // Returns 23
C.prototype.__defineSetter__('x', function(value) { this.y = 23; });
new C().x;  // Still returns 23

Mar 4, 2010
Project Member #1 sgjesse@chromium.org
 Issue 629  has been merged into this issue.
Mar 4, 2010
Project Member #2 sgjesse@chromium.org
When this is fixed the test-api/SetterOnConstructorPrototype should be able to run as 
THREADED_TEST again.
Jun 22, 2011
#3 erights@google.com
Please label with ES5 tag.
Jun 23, 2011
Project Member #4 sgjesse@chromium.org
(No comment was entered for this change.)
Labels: ES5
May 31, 2012
Project Member #5 rossb...@chromium.org
I'm snatching this one, since it's closely related to the readonliness fix.
Owner: rossb...@chromium.org
Cc: mstarzinger@chromium.org
Jun 4, 2013
Project Member #6 verwa...@chromium.org
I'm snatching this one harder. Will be fixed inhttps://codereview.chromium.org/15993016/
Status: Fixed
Owner: verwa...@chromium.org
Cc: rossb...@chromium.org
Sign in to add a comment

Powered by Google Project Hosting