Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
3b9e5e3
Prototype binary encoding.
juj Mar 5, 2024
059699a
Fix Closure minification around binaryDecode() function.
juj Mar 5, 2024
735af53
Make binary encoding work in default runtime.
juj Mar 6, 2024
ed9b7e1
Default enable SINGLE_FILE_BINARY_ENCODE
juj Mar 6, 2024
926fde4
Remove old code
juj Mar 6, 2024
85d6ea4
Cleanup encoding code
juj Mar 6, 2024
e199eb0
Flake
juj Mar 6, 2024
23007c1
Flake
juj Mar 6, 2024
451fc77
tools\maint\update_settings_docs.py
juj Mar 6, 2024
cdd1719
Simplify
juj Mar 6, 2024
d4c8067
Fix Closure invocation.
juj Mar 6, 2024
6435c68
Rebaseline code size tests.
juj Mar 6, 2024
426c9d2
Fix typo
juj Mar 6, 2024
ca63b7b
Fix browser.test_single_file_worker_js
juj Mar 6, 2024
a27937f
Fix browser.test_modularize
juj Mar 6, 2024
7eb94f2
Proper ifdef gate.
juj Mar 6, 2024
66db56c
Remove code duplication.
juj Mar 6, 2024
46fa3b8
Resolve todo
juj Mar 6, 2024
0fad312
eslint
juj Mar 6, 2024
bb8f0f5
Disable SINGLE_FILE_BINARY_ENCODE by default
juj Mar 7, 2024
f8d9641
Fix refactoring.
juj Mar 8, 2024
0317531
Include test for -sSINGLE_FILE_BINARY_ENCODE=0/1 modes.
juj Mar 8, 2024
3ac3aab
Address review
juj Mar 26, 2024
514759b
Merge remote-tracking branch 'origin/main' into binary_encode
juj Mar 26, 2024
77badc9
Merge remote-tracking branch 'origin/main' into binary_encode
juj Aug 27, 2024
ea729f0
Fix merge
juj Aug 27, 2024
1b163d2
Clean up merge
juj Aug 27, 2024
09c5aa8
Run tools\maint\update_settings_docs.py
juj Aug 27, 2024
da757b9
Rebaseline code size tests
juj Aug 27, 2024
9abe835
Add new test for WebGL 2 code size in binary encoded singlefile mode.…
juj Aug 27, 2024
b7e9a2c
Fix call to binaryDecode() after merge
juj Aug 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix browser.test_modularize
  • Loading branch information
juj committed Mar 15, 2024
commit a27937f70bc9dfca80acb7552546e90c61911f58
6 changes: 5 additions & 1 deletion src/preamble.js
Original file line number Diff line number Diff line change
Expand Up @@ -595,9 +595,12 @@ var wasmBinaryFile;
if (Module['locateFile']) {
#endif
wasmBinaryFile = '{{{ WASM_BINARY_FILE }}}';
#if !SINGLE_FILE
if (!isDataURI(wasmBinaryFile)) {
wasmBinaryFile = locateFile(wasmBinaryFile);
}
#endif

#if EXPORT_ES6 && USE_ES6_IMPORT_META && !SINGLE_FILE && !AUDIO_WORKLET // In single-file mode, repeating WASM_BINARY_FILE would emit the contents again. For an Audio Worklet, we cannot use `new URL()`.
} else {
#if ENVIRONMENT_MAY_BE_SHELL
Expand All @@ -612,11 +615,12 @@ if (Module['locateFile']) {

#if SINGLE_FILE && SINGLE_FILE_BINARY_ENCODE
function binaryDecode(bin) { for(var i=0,l=bin.length,o=new Uint8Array(l);i<l;++i) o[i]=bin.charCodeAt(i)-1; return o; }
wasmBinaryFile = binaryDecode(wasmBinaryFile);
#endif

function getBinarySync(file) {
#if SINGLE_FILE && SINGLE_FILE_BINARY_ENCODE
return binaryDecode(file);
return file;
#else
if (file == wasmBinaryFile && wasmBinary) {
return new Uint8Array(wasmBinary);
Expand Down
2 changes: 2 additions & 0 deletions test/test_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -3421,10 +3421,12 @@ def test_modularize(self):
# this test is synchronous, so avoid async startup due to wasm features
self.compile_btest('browser_test_hello_world.c', ['-sMODULARIZE', '-sSINGLE_FILE'] + args + opts)
create_file('a.html', '''
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"></head><body>
<script src="a.out.js"></script>
<script>
%s
</script>
</body></html>
''' % code)
self.run_browser('a.html', '/report_result?0')

Expand Down