Skip to content

Commit

Permalink
print arrayUtils/base64Utils earlier (via @erikdubbelboer) (#5296)
Browse files Browse the repository at this point in the history
  • Loading branch information
buu700 committed Oct 10, 2017
1 parent 60fc52b commit eae3ed5
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/jsifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,18 @@ function JSify(data, functionsOnly) {
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');
}

print(preprocess(read('arrayUtils.js')));
// Export all arrayUtils.js functions
print(maybeExport('intArrayFromString'));
print(maybeExport('intArrayToString'));

if (SUPPORT_BASE64_EMBEDDING) {
print(preprocess(read('base64Utils.js')));
// Export all base64Utils.js functions
print(maybeExport('intArrayFromBase64'));
print(maybeExport('tryParseAsDataURI'));
}

if (asmLibraryFunctions.length > 0) {
print('// ASM_LIBRARY FUNCTIONS');
function fix(f) { // fix indenting to not confuse js optimizer
Expand All @@ -541,17 +553,6 @@ function JSify(data, functionsOnly) {

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

print(preprocess(read('arrayUtils.js')));
// Export all arrayUtils.js functions
print(maybeExport('intArrayFromString'));
print(maybeExport('intArrayToString'));

if (SUPPORT_BASE64_EMBEDDING) {
print(preprocess(read('base64Utils.js')));
// Export all base64Utils.js functions
print(maybeExport('intArrayFromBase64'));
print(maybeExport('tryParseAsDataURI'));
}
if (HEADLESS) {
print('if (!ENVIRONMENT_IS_WEB) {');
print(read('headlessCanvas.js'));
Expand Down

0 comments on commit eae3ed5

Please sign in to comment.