>> [#Changes: >> - don't create private vars on the prototype, instead 'create' them in >> the constructor (as this._privateVar), as shown in the example >> >> I'm not sure which example you refer to. But what is the difference, if > you still assign the value to this._privateVar? > The real difference is whether the right-hand side of the assignment is a > constant, immutable value. Then you can safely add the value to the > prototype and even save some memory at runtime (while losing a microsecond > for prototype-chain-lookup). However, if it is a dynamic expression or > evaluated to a mutable object (like e.g. an Array), you have to make sure > that every object instance receives its own fresh instance, and so the > assignment has to be placed in the constructor.
Yes, which is why I indicated the change. The example I refer to is buried in the "[ASJS] Some information on "templates" thread. If/when I get access to the Wiki, I'll start a table of AS 'features' and the proposed 'translation' to (Google Closure) JS. EdB -- Ix Multimedia Software Jan Luykenstraat 27 3521 VB Utrecht T. 06-51952295 I. www.ixsoftware.nl