[Proto-Scripty] Prototype class-instances sharing properties

2010-12-04 Thread Luke
Hi, I've got a weird behavior here, or rather a behavior I don't understand. If you take the following Class: --- var SomeClass = Class.create({ rbBuffer: nulll, setBuffer: function(val) { this.rbBuffer = val; }, getBuffer: function() { return this.rbBuffer; } }); --- and

Re: [Proto-Scripty] Prototype class-instances sharing properties

2010-12-04 Thread yuval dagan
Hi currently the rdBuff is shared between all instatces try to create the instance variable (here rdBuff) inside the initialize function and with the this keyword its not default like in C++ etc... var SomeClass = Class.create({ initialize: function(name) { this.rbBuffer = {}; },