Skip to content

Commit 73ee038

Browse files
Use __filename for 'getExecutingFilePath'.
1 parent 5c8173b commit 73ee038

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/compiler/sys.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ declare var require: any;
2525
declare var module: any;
2626
declare var process: any;
2727
declare var global: any;
28+
declare var __filename: string;
2829

2930
var sys: System = (function () {
3031

@@ -224,10 +225,10 @@ var sys: System = (function () {
224225
}
225226
},
226227
getExecutingFilePath() {
227-
return process.mainModule.filename;
228+
return __filename;
228229
},
229230
getCurrentDirectory() {
230-
return (<any>process).cwd();
231+
return process.cwd();
231232
},
232233
getMemoryUsage() {
233234
if (global.gc) {

src/harness/harness.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
// this will work in the browser via browserify
2626
var _chai: typeof chai = require('chai');
2727
var assert: typeof _chai.assert = _chai.assert;
28-
declare var __dirname: any; // Node-specific
28+
declare var __dirname: string; // Node-specific
2929
var global = <any>Function("return this").call(null);
3030

3131
module Utils {

0 commit comments

Comments
 (0)