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
5927a1a0
...
5927a1a0fea56f36e77dad3853b07db362ff5ef6
authored
2013-11-28 05:29:08 -0800
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge pull request #733 from laurentj/issue-732
Fixed betterInstanceOf for Gecko
2 parents
6ad2eead
0e5d3ab7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
modules/utils.js
modules/utils.js
View file @
5927a1a
...
...
@@ -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__
;
input
ToTest
=
inputToTes
t
.
__proto__
;
}
return
false
;
return
equals
(
input
.
constructor
.
name
,
constructor
.
name
)
;
}
exports
.
betterInstanceOf
=
betterInstanceOf
;
...
...
Please
register
or
sign in
to post a comment