mirror of https://gitee.com/bigwinds/arangodb
Added __dirname, __filename pseudo-globals. Fixes #733.
This commit is contained in:
parent
0c039e0264
commit
3e653e303d
|
@ -735,6 +735,8 @@ function require (path) {
|
|||
}
|
||||
}
|
||||
|
||||
sandbox.__filename = origin;
|
||||
sandbox.__dirname = typeof origin === 'string' ? origin.split('/').slice(0, -1).join('/') : origin;
|
||||
sandbox.module = module;
|
||||
sandbox.exports = module.exports;
|
||||
sandbox.require = function(path) { return module.require(path); };
|
||||
|
@ -1326,6 +1328,8 @@ function require (path) {
|
|||
}
|
||||
}
|
||||
|
||||
sandbox.__filename = full;
|
||||
sandbox.__dirname = full.split('/').slice(0, -1).join('/');
|
||||
sandbox.module = appModule;
|
||||
sandbox.applicationContext = appContext;
|
||||
|
||||
|
|
Loading…
Reference in New Issue