Skip to content

Commit eae3ed5

Browse files
committed
print arrayUtils/base64Utils earlier (via @erikdubbelboer) (#5296)
1 parent 60fc52b commit eae3ed5

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

src/jsifier.js

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,18 @@ function JSify(data, functionsOnly) {
522522
print('assert(STACK_MAX < SPLIT_MEMORY, "SPLIT_MEMORY size must be big enough so the entire static memory + stack can fit in one chunk, need " + STACK_MAX);\n');
523523
}
524524

525+
print(preprocess(read('arrayUtils.js')));
526+
// Export all arrayUtils.js functions
527+
print(maybeExport('intArrayFromString'));
528+
print(maybeExport('intArrayToString'));
529+
530+
if (SUPPORT_BASE64_EMBEDDING) {
531+
print(preprocess(read('base64Utils.js')));
532+
// Export all base64Utils.js functions
533+
print(maybeExport('intArrayFromBase64'));
534+
print(maybeExport('tryParseAsDataURI'));
535+
}
536+
525537
if (asmLibraryFunctions.length > 0) {
526538
print('// ASM_LIBRARY FUNCTIONS');
527539
function fix(f) { // fix indenting to not confuse js optimizer
@@ -541,17 +553,6 @@ function JSify(data, functionsOnly) {
541553

542554
if (ASSERTIONS) print('var ASSERTIONS = true;\n');
543555

544-
print(preprocess(read('arrayUtils.js')));
545-
// Export all arrayUtils.js functions
546-
print(maybeExport('intArrayFromString'));
547-
print(maybeExport('intArrayToString'));
548-
549-
if (SUPPORT_BASE64_EMBEDDING) {
550-
print(preprocess(read('base64Utils.js')));
551-
// Export all base64Utils.js functions
552-
print(maybeExport('intArrayFromBase64'));
553-
print(maybeExport('tryParseAsDataURI'));
554-
}
555556
if (HEADLESS) {
556557
print('if (!ENVIRONMENT_IS_WEB) {');
557558
print(read('headlessCanvas.js'));

0 commit comments

Comments
 (0)