diff --git a/lib/bootstrap.js b/lib/bootstrap.js index 26eef2f6..ccde8615 100644 --- a/lib/bootstrap.js +++ b/lib/bootstrap.js @@ -201,9 +201,13 @@ new function() { read: function(args, index, length) { var index = index || 0, length = length || args.length - index; - if (length == 1 && args[index] instanceof this) { - return args[index]; - } else if (length != 0) { + if (length == 1) { + var arg = args[index]; + // Return null when only null was provided + if (arg instanceof this || arg == null) + return arg; + } + if (length > 0) { var obj = new this(this.dont); obj = obj.initialize.apply(obj, index > 0 || length < args.length ? Array.prototype.slice.call(args, index, index + length)