It seems that the collection array is growing for each instance of foo and
bar class. I would expect that the collection array contains 1 item for
each instance. What is wrong? Is this a bug, or expected results?
Karl..
My Test Code:
var base = Class.create({
collection: [],
itterations:0,
initialize: function() {
this.itterations++;
this.collection.push(this.itterations);
console.log('Itterations: %s, Number items in Collection: %s',
this.itterations, this.collection.size());
}
});
var foo = Class.create(base, {});
var bar = Class.create(base, {});
var _foo = new foo(); // expecting ==> Itterations: 1, Number items in
Collection: 1
var _bar = new bar(); // expecting ==> Itterations: 1, Number items in
Collection: 1
// _foo is correct, but Actual results for _bar ==> Itterations: 1, Number
items in Collection: 2
--
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/-/dKCzq58L6PgJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en.