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
0e5d3ab7
...
0e5d3ab72dc4165f93d2b76f62e6e760284c4728
authored
2013-11-28 10:06:42 +0100
by
Laurent Jouanneau
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Fixed betterInstanceOf for Gecko
Some tests fail with SlimerJS... Closes #732
1 parent
4a306e65
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
modules/utils.js
modules/utils.js
View file @
0e5d3ab
...
...
@@ -81,19 +81,23 @@ exports.betterTypeOf = betterTypeOf;
function
betterInstanceOf
(
input
,
constructor
)
{
"use strict"
;
/*jshint eqnull:true, eqeqeq:false */
while
(
input
!=
null
)
{
if
(
input
==
constructor
.
prototype
)
{
if
(
typeof
input
==
'undefined'
||
input
==
null
)
{
return
false
;
}
var
inputToTest
=
input
;
while
(
inputToTest
!=
null
)
{
if
(
inputToTest
==
constructor
.
prototype
)
{
return
true
;
}
if
(
typeof
input
==
'xml'
)
{
if
(
typeof
input
ToTest
==
'xml'
)
{
return
constructor
.
prototype
==
document
.
prototype
;
}
if
(
typeof
input
==
'undefined'
)
{
if
(
typeof
input
ToTest
==
'undefined'
)
{
return
false
;
}
input
=
inpu
t
.
__proto__
;
}
return
false
;
input
ToTest
=
inputToTes
t
.
__proto__
;
}
return
equals
(
input
.
constructor
.
name
,
constructor
.
name
)
;
}
exports
.
betterInstanceOf
=
betterInstanceOf
;
...
...
Please
register
or
sign in
to post a comment