mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Change Base.read to not return an object if only null is provided.
This commit is contained in:
parent
acb6e850a0
commit
101cb11973
1 changed files with 7 additions and 3 deletions
10
lib/bootstrap.js
vendored
10
lib/bootstrap.js
vendored
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue