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
22f5e13f
...
22f5e13f4b49973735b57ceb5a0c0c3b65dd2137
authored
2012-05-01 07:49:45 +0200
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
ensure patched require() is available within scripts
1 parent
a24309d3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
bin/bootstrap.js
bin/bootstrap.js
View file @
22f5e13
...
...
@@ -192,7 +192,6 @@ phantom.loadCasper = function loadCasper() {
* @param Function callback An optional callback
*/
phantom
.
processScriptError
=
function
processScriptError
(
error
,
file
,
callback
)
{
console
.
log
(
error
,
file
,
callback
)
if
(
error
.
sourceId
&&
!
this
.
sourceIds
.
hasOwnProperty
(
error
.
sourceId
))
{
this
.
sourceIds
[
error
.
sourceId
]
=
file
;
}
...
...
@@ -269,7 +268,8 @@ phantom.loadCasper = function loadCasper() {
}
try
{
var
scriptCode
=
phantom
.
getScriptCode
(
file
);
new
Function
(
'module'
,
'exports'
,
scriptCode
)(
module
,
module
.
exports
);
var
fn
=
new
Function
(
'require'
,
'module'
,
'exports'
,
scriptCode
);
fn
(
_require
,
module
,
module
.
exports
);
}
catch
(
e
)
{
phantom
.
processScriptError
(
e
,
file
);
}
...
...
Please
register
or
sign in
to post a comment