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 d
On Oct 21, 2:03 pm, buda 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 to have. If
th
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
_
Hi,
On Oct 20, 3:33 am, buda 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`
releases the `it
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
https://groups.google.com/d/msg/pr
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
https://groups.google.com/d/msg/pr
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
https://groups.google.com/d/msg/pr
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
https://groups.google.com/d/msg/pr
I use destroy method on the class and clean everythig in it
On 18 окт, 14:17, "T.J. Crowder" wrote:
> On Oct 18, 10:29 am, buda 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
On Oct 18, 10:29 am, buda 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 = [];
>
> function initi
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 i
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
https://g
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;
On Oct 18, 6:01 am, buda 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 = Object.clone(a);
dis
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, s
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 t
Here is a sample from my code http://jsfiddle.net/QW8vM/9/
On 17 окт, 12:33, "T.J. Crowder" wrote:
> On Oct 17, 10:17 am, "T.J. Crowder" 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
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" wrote:
> On Oct 17, 10:17 am, "T.J. Crowder" wrote:
>
> > It's very hard to help when the code
> > presented is fundamentally broken and yet reported as working.
>
> Sorry,
On Oct 17, 10:17 am, "T.J. Crowder" 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 that's a
bit more cleaned
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 fundamental
20 matches
Mail list logo