Refs #482: fixes utils.equals for gecko
Using instanceof is not enough for Gecko.
Showing
1 changed file
with
4 additions
and
2 deletions
... | @@ -143,8 +143,10 @@ function equals(v1, v2) { | ... | @@ -143,8 +143,10 @@ function equals(v1, v2) { |
143 | if (isFunction(v1)) { | 143 | if (isFunction(v1)) { |
144 | return v1.toString() === v2.toString(); | 144 | return v1.toString() === v2.toString(); |
145 | } | 145 | } |
146 | if (v1 instanceof Object) { | 146 | // with Gecko, instanceof is not enough to test object |
147 | if (!(v2 instanceof Object) || Object.keys(v1).length !== Object.keys(v2).length) { | 147 | if (v1 instanceof Object || isObject(v1)) { |
148 | if (!(v2 instanceof Object || isObject(v2)) || | ||
149 | Object.keys(v1).length !== Object.keys(v2).length) { | ||
148 | return false; | 150 | return false; |
149 | } | 151 | } |
150 | for (var k in v1) { | 152 | for (var k in v1) { | ... | ... |
-
Please register or sign in to post a comment