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
4019e76d
...
4019e76dbc07a508a862ac3f84688667574e8c4e
authored
2012-05-01 12:15:55 +0200
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
added the python-like __file__ variable available within modules
1 parent
34f47682
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
bin/bootstrap.js
bin/bootstrap.js
View file @
4019e76
...
...
@@ -205,9 +205,9 @@ phantom.loadCasper = function loadCasper() {
return
requireCache
[
file
].
exports
;
}
var
scriptCode
=
phantom
.
getScriptCode
(
file
);
var
fn
=
new
Function
(
'require'
,
'module'
,
'exports'
,
scriptCode
);
var
fn
=
new
Function
(
'
__file__'
,
'
require'
,
'module'
,
'exports'
,
scriptCode
);
try
{
fn
(
_require
,
module
,
module
.
exports
);
fn
(
file
,
_require
,
module
,
module
.
exports
);
}
catch
(
e
)
{
var
error
=
new
CasperError
(
'__mod_error('
+
path
+
'):: '
+
e
);
error
.
file
=
file
;
...
...
Please
register
or
sign in
to post a comment