Allow read() methods to receive an optional length parameter.

This commit is contained in:
Jürg Lehni 2011-03-03 13:15:55 +00:00
parent ecbd52cdf7
commit 3a46ac3b54
6 changed files with 12 additions and 12 deletions
src/basic

View file

@ -94,8 +94,8 @@ var Size = Base.extend({
},
statics: {
read: function(args, index) {
var index = index || 0, length = args.length - index;
read: function(args, index, length) {
var index = index || 0, length = length || args.length - index;
if (length == 1 && args[index] instanceof Size) {
return args[index];
} else if (length != 0) {