Skip to content

Commit 768b56c

Browse files
committed
consolidate Module.thisProgram
1 parent e61582c commit 768b56c

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/library.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3187,7 +3187,7 @@ LibraryManager.library = {
31873187
ENV['PWD'] = '/';
31883188
ENV['HOME'] = '/home/web_user';
31893189
ENV['LANG'] = 'C';
3190-
ENV['_'] = Module['thisProgram'] || './this.program';
3190+
ENV['_'] = Module['thisProgram'];
31913191
// Allocate memory.
31923192
poolPtr = allocate(TOTAL_ENV_SIZE, 'i8', ALLOC_STATIC);
31933193
envPtr = allocate(MAX_ENV_VALUES * {{{ Runtime.QUANTUM_SIZE }}},

src/postamble.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Module['callMain'] = Module.callMain = function callMain(args) {
6464
argv.push(0);
6565
}
6666
}
67-
var argv = [allocate(intArrayFromString(Module['thisProgram'] || './this.program'), 'i8', ALLOC_NORMAL) ];
67+
var argv = [allocate(intArrayFromString(Module['thisProgram']), 'i8', ALLOC_NORMAL) ];
6868
pad();
6969
for (var i = 0; i < argc-1; i = i + 1) {
7070
argv.push(allocate(intArrayFromString(args[i]), 'i8', ALLOC_NORMAL));

src/shell.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ if (!Module['printErr']) {
162162
if (!Module['arguments']) {
163163
Module['arguments'] = [];
164164
}
165+
if (!Module['thisProgram']) {
166+
Module['thisProgram'] = './this.program';
167+
}
168+
165169
// *** Environment setup code ***
166170

167171
// Closure helpers

0 commit comments

Comments
 (0)