On 2007-09-22, at 17:52 EDT, liorean wrote:

> Which could be done, of course, it should be a simple thing to add
> that in the algorithm for [[Construct]]. But then we have the question
> of what to do with constructors that return other objects than that
> set up by steps 1 through 5 of the [[Construct]] algorithm. A
> constructor can return other objects, you know. You'd have to decide
> whether this property should be set up prior to step 6 in the
> algorithm or subsequent to step 7. If prior, only the original object
> that was created in step 1 gets it, if subsequent, return values get
> it even if they are not the same as the original object.

Dylan has a rule that the constructor must return an object that is a  
subtype of the constructor.  If that were enforced, I would see no  
reason to reset the constructor property of the returned object.

> Actually, I think this would be a nice and simple fix to ES3 that
> probably wouldn't hurt much code out there.

Agreed.  As I mentioned elsewhere in this thread, we do this manually  
in our framework for now.

_______________________________________________
Es4-discuss mailing list
Es4-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es4-discuss

Reply via email to