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
00ae83c8
...
00ae83c8dfe47faa638160cf1c76ef23c46cd762
authored
2012-11-24 16:44:33 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
simplified CasopeR.getGlobal()
1 parent
c6977c14
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
2 deletions
modules/casper.js
modules/casper.js
View file @
00ae83c
...
...
@@ -871,14 +871,13 @@ Casper.prototype.getGlobal = function getGlobal(name) {
}
return
result
;
},
name
);
if
(
typeof
result
!==
"object"
)
{
if
(
!
utils
.
isObject
(
result
)
)
{
throw
new
CasperError
(
f
(
'Could not retrieve global value for "%s"'
,
name
));
}
else
if
(
'error'
in
result
)
{
throw
new
CasperError
(
result
.
error
);
}
else
if
(
utils
.
isString
(
result
.
value
))
{
return
JSON
.
parse
(
result
.
value
);
}
return
undefined
;
};
/**
...
...
Please
register
or
sign in
to post a comment