Closed cappelaere closed 11 years ago
Fix: Collection.js:467 'extend': { value: function(methods, callback) { for (var method in methods) { Object.defineProperty(this, method, { // value: function() { // console.log("defineProperty:", m, methods[m]) // return methods[method].apply(this, arguments); // }, value: methods[method], writable: true, enumerable: false }); } if (callback) return callback(this); else return this; }, writable: true, enumerable: false }
Thanks for bug report, will take a closer look by the end of the week + adding tests.
var set = new Vector([10, 82, 67, 17, 36 ]); set.extend( { 'two': function() { this[2] }, 'three': function() { this[3]}, 'four': function() { this[4]} }) console.log("two:", set.two()) console.log("three:", set.three())
->two: 36 ->three: 36 which is set.four()