Ticket #141 (new defect)

Opened 1 year ago

Last modified 1 year ago

(Resolved) Prototype-based delegation from function constructed object to class instance

Reported by: brendan Assigned to: anonymous
Type: defect Priority: trivial
Milestone: Component: Spec
Version: 4 Keywords:
Cc: lth,graydon,cormac,jeffdyer,chris

Description

Kris Zyp raised this on es4-discuss. Given

class C {
  var x : int = 42;
  function C(x) : x = x {}
  public function m():int x
}
c = new C;
function F() {}
F.prototype = c;
f = new F;

Right now, setting f.x = 33 sets c.x, and the type constraint is enforced. This is a bug: there should be an expando shadowing c.x created in the Object instance f that was created by new F.

Need Proposal or Spec language, then RefImpl? fixing -- or perhaps the latter if we have the former, but it's not clear to me that we have a spec requiring this yet.

/be

Attachments

Change History

Changed 1 year ago by lth

  • owner deleted
  • component changed from Proposals to Spec

Simple spec/refimpl issue IMO, the behavior here should just follow from standard ES3 rules, no?

Changed 1 year ago by lth

  • summary changed from prototype-based delegation from function constructed object to class instance to (Resolved) Prototype-based delegation from function constructed object to class instance

Changed 1 year ago by lth

  • priority changed from major to trivial
Note: See TracTickets for help on using tickets.