Use the new statics: true setting for Base injection, and fix Array.prototype.slice issue in Base.read().

This commit is contained in:
Jürg Lehni 2011-03-05 14:23:42 +00:00
parent 3f0a45a7c2
commit cfb7d195c0

View file

@ -13,7 +13,8 @@ this.install = function(scope) {
//#include "../lib/bootstrap.js" //#include "../lib/bootstrap.js"
Base.inject({ Base.inject({
statics: { statics: true,
read: function(args, index, length) { read: function(args, index, length) {
var index = index || 0, length = length || args.length - index; var index = index || 0, length = length || args.length - index;
if (length <= 1) { if (length <= 1) {
@ -24,7 +25,7 @@ Base.inject({
} }
var obj = new this(this.dont); var obj = new this(this.dont);
obj = obj.initialize.apply(obj, index > 0 || length < args.length obj = obj.initialize.apply(obj, index > 0 || length < args.length
? slice.call(args, index, index + length) ? Array.prototype.slice.call(args, index, index + length)
: args) || obj; : args) || obj;
return obj; return obj;
}, },
@ -34,7 +35,6 @@ Base.inject({
return match.toUpperCase(); return match.toUpperCase();
}); });
} }
}
}); });