Hi T.J.!
Thanks for your help!
This code will be sheared and there is the risk that people have an ability
involuntarily to change privates - so I need to protect it
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this
Hi,
On Oct 20, 3:33 am, buda www...@pochta.ru wrote:
T.J. here is the example of using instance private vaiables store in use
-http://jsfiddle.net/QW8vM/17/
FWIW, that code refers to an undefined symbol `_items` in the property
getter function. Also note that it has a memory leak: `destroy`
Hi!
Thanks for response.
`_items` - it's typo ;) of course there mightbe - return _privates[this.
internalId].items.slice(0);
I agree with you about error in destroy - not deleting an instance item in
_privates array.
About not using such pattern - I agree if only few methods need to access
On Oct 21, 2:03 pm, buda www...@pochta.ru wrote:
About not using such pattern - I agree if only few methods need to access
_privates, but what if an object has about 10 or more methods that
manipulate _privates!? make them all per instance?
It depends entirely on how many instances you expect
T.J. here is the example of using instange private vaiables store in use -
http://jsfiddle.net/QW8vM/13/
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this discussion on the web visit
T.J. here is the example of using instange private vaiables store in use -
http://jsfiddle.net/QW8vM/16/
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this discussion on the web visit
T.J. here is the example of using instange private vaiables store in use -
http://jsfiddle.net/QW8vM/17/
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this discussion on the web visit
T.J. here is the example of using instance private vaiables store in use -
http://jsfiddle.net/QW8vM/17/
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this discussion on the web visit
On Oct 18, 6:01 am, buda www...@pochta.ru wrote:
here the code http://jsfiddle.net/QW8vM/10/
`Object.clone` returns a raw object with a shallow copy of the
properties of the object you give it. It is not a perfect copy of the
object down to the prototype level:
var a, b;
a = [1, 2, 3];
b =
it's general example for show the problem with Object.clone :)
Usually I use anothe technique:
var a = Class.create((function(){.
var instancePrivates = [];
function initialize(){
var internalId;
instancePrivates.push({});
internalId = --instancePrivates;
in last example of course
this.internalId = --instancePrivates;
instead of
var internalId;
internalId = --instancePrivates;
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this discussion on the web visit
that sample was to demonstarte Object.clone bug :)
Usually I us to
var a = Class.create((function() {
var _privates = [];
function initialize() {
_privates.push({});
this.internalId = _privates.length-1;
_privates[this.internalId].items = []; -- here the instances
On Oct 18, 10:29 am, buda www...@pochta.ru wrote:
that sample was to demonstarte Object.clone bug :)
It's not a bug, though I'd say detecting that it's being fed an array
wouldn't be a bad feature to add.
Usually I us to
var a = Class.create((function() {
var _privates = [];
I use destroy method on the class and clean everythig in it
On 18 окт, 14:17, T.J. Crowder t...@crowdersoftware.com wrote:
On Oct 18, 10:29 am, buda www...@pochta.ru wrote:
that sample was to demonstarte Object.clone bug :)
It's not a bug, though I'd say detecting that it's being fed an
Hi,
The code you've quoted has a variety of syntax errors and typos, such
as using `function initialize()` within an object literal (which
results in an Unexpected identifier error) and using `Class.Create`
rather than `Class.create`. It's very hard to help when the code
presented is
On Oct 17, 10:17 am, T.J. Crowder t...@crowdersoftware.com wrote:
It's very hard to help when the code
presented is fundamentally broken and yet reported as working.
Sorry, in print that comes across much more harshly than it was
intended to. I only mean that it's easier to help debug code
it's ok T.J. - I'll try to write a test on JS Bin and write link here
to reproduce the bug
On 17 окт, 12:33, T.J. Crowder t...@crowdersoftware.com wrote:
On Oct 17, 10:17 am, T.J. Crowder t...@crowdersoftware.com wrote:
It's very hard to help when the code
presented is fundamentally broken
Here is a sample from my code http://jsfiddle.net/QW8vM/9/
On 17 окт, 12:33, T.J. Crowder t...@crowdersoftware.com wrote:
On Oct 17, 10:17 am, T.J. Crowder t...@crowdersoftware.com wrote:
It's very hard to help when the code
presented is fundamentally broken and yet reported as working.
sorry - this is a write link http://jsfiddle.net/QW8vM/10/
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this discussion on the web visit
https://groups.google.com/d/msg/prototype-scriptaculous/-/3QhVzBt2bpUJ.
To post to
here the code http://jsfiddle.net/QW8vM/10/
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this discussion on the web visit
https://groups.google.com/d/msg/prototype-scriptaculous/-/NzCfXch19G8J.
To post to this group,
20 matches
Mail list logo