Skip to content

Commit 325ae7c

Browse files
authored
Move #include's out of jsifier.js and into postamble.js. NFC (#19613)
1 parent 90858c8 commit 325ae7c

File tree

2 files changed

+25
-22
lines changed

2 files changed

+25
-22
lines changed

src/jsifier.js

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -557,35 +557,16 @@ function(${args}) {
557557
print('\nvar proxiedFunctionTable = [' + proxiedFunctionTable.join() + '];\n');
558558
}
559559

560-
if ((SUPPORT_BASE64_EMBEDDING || FORCE_FILESYSTEM) && !MINIMAL_RUNTIME) {
561-
includeFile('base64Utils.js');
562-
}
563-
564560
if (abortExecution) {
565561
throw Error('Aborting compilation due to previous errors');
566562
}
567563

568-
// This is the main 'post' pass. Print out the generated code that we have here, together with the
569-
// rest of the output that we started to print out earlier (see comment on the
564+
// This is the main 'post' pass. Print out the generated code
565+
// that we have here, together with the rest of the output
566+
// that we started to print out earlier (see comment on the
570567
// "Final shape that will be created").
571568
print('// EMSCRIPTEN_END_FUNCS\n');
572569

573-
if (HEADLESS) {
574-
print('if (!ENVIRONMENT_IS_WEB) {');
575-
includeFile('headlessCanvas.js');
576-
includeFile('headless.js')
577-
print('}');
578-
}
579-
if (PROXY_TO_WORKER) {
580-
print('if (ENVIRONMENT_IS_WORKER) {\n');
581-
includeFile('webGLWorker.js');
582-
includeFile('proxyWorker.js');
583-
print('}');
584-
}
585-
if (DETERMINISTIC) {
586-
includeFile('deterministic.js');
587-
}
588-
589570
const postFile = MINIMAL_RUNTIME ? 'postamble_minimal.js' : 'postamble.js';
590571
includeFile(postFile);
591572

src/postamble.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,28 @@
66

77
// === Auto-generated postamble setup entry stuff ===
88

9+
#if SUPPORT_BASE64_EMBEDDING || FORCE_FILESYSTEM
10+
#include "base64Utils.js"
11+
#endif
12+
13+
#if HEADLESS
14+
if (!ENVIRONMENT_IS_WEB) {
15+
#include "headlessCanvas.js"
16+
#include "headless.js"
17+
}
18+
#endif
19+
20+
#if PROXY_TO_WORKER
21+
if (ENVIRONMENT_IS_WORKER) {
22+
#include "webGLWorker.js'
23+
#include "proxyWorker.js"
24+
}
25+
#endif
26+
27+
#if DETERMINISTIC
28+
#include "deterministic.js"
29+
#endif
30+
931
{{{ exportRuntime() }}}
1032

1133
var calledRun;

0 commit comments

Comments
 (0)