Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
casperjs
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
32fd8684
...
32fd8684e028fcc4e1d7a6e851edfca56babf39b
authored
2013-06-20 08:21:38 +0200
by
Laurent Jouanneau
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Refs #482: fixes utils.equals for gecko
Using instanceof is not enough for Gecko.
1 parent
7806150c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
modules/utils.js
modules/utils.js
View file @
32fd868
...
...
@@ -143,8 +143,10 @@ function equals(v1, v2) {
if
(
isFunction
(
v1
))
{
return
v1
.
toString
()
===
v2
.
toString
();
}
if
(
v1
instanceof
Object
)
{
if
(
!
(
v2
instanceof
Object
)
||
Object
.
keys
(
v1
).
length
!==
Object
.
keys
(
v2
).
length
)
{
// with Gecko, instanceof is not enough to test object
if
(
v1
instanceof
Object
||
isObject
(
v1
))
{
if
(
!
(
v2
instanceof
Object
||
isObject
(
v2
))
||
Object
.
keys
(
v1
).
length
!==
Object
.
keys
(
v2
).
length
)
{
return
false
;
}
for
(
var
k
in
v1
)
{
...
...
Please
register
or
sign in
to post a comment