mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 14:10:14 -05:00
Fix issues with Base.equals().
This commit is contained in:
parent
65f1e5c66d
commit
0a537f0712
1 changed files with 5 additions and 2 deletions
7
lib/bootstrap.js
vendored
7
lib/bootstrap.js
vendored
|
@ -234,8 +234,10 @@ var Base = new function() { // Bootstrap scope
|
|||
* equals() methods if available, and also comparing elements of arrays.
|
||||
*/
|
||||
function equals(obj1, obj2) {
|
||||
if (obj1 == obj2 || obj1 != null && obj1.equals && obj1.equals(obj2))
|
||||
if (obj1 == obj2)
|
||||
return true;
|
||||
if (obj1 != null && obj1.equals)
|
||||
return obj1.equals(obj2);
|
||||
if (isArray(obj1) && isArray(obj2)) {
|
||||
if (obj1.length !== obj2.length)
|
||||
return false;
|
||||
|
@ -244,7 +246,8 @@ var Base = new function() { // Bootstrap scope
|
|||
return false;
|
||||
}
|
||||
return true;
|
||||
} else if (typeof obj1 === 'object' && typeof obj2 === 'object') {
|
||||
}
|
||||
if (typeof obj1 === 'object' && typeof obj2 === 'object') {
|
||||
function checkKeys(o1, o2) {
|
||||
for (var i in o1)
|
||||
if (typeof o2[i] === 'undefined')
|
||||
|
|
Loading…
Reference in a new issue