Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
36 changes: 5 additions & 31 deletions src/lib/libcore.js
Original file line number Diff line number Diff line change
Expand Up @@ -1967,42 +1967,16 @@ addToLibrary({
_emscripten_get_progname__deps: ['$getExecutableName', '$stringToUTF8'],
_emscripten_get_progname: (str, len) => stringToUTF8(getExecutableName(), str, len),

emscripten_console_log: (str) => {
#if ASSERTIONS
assert(typeof str == 'number');
#endif
console.log(UTF8ToString(str));
},

emscripten_console_warn: (str) => {
#if ASSERTIONS
assert(typeof str == 'number');
#endif
console.warn(UTF8ToString(str));
},

emscripten_console_error: (str) => {
#if ASSERTIONS
assert(typeof str == 'number');
#endif
console.error(UTF8ToString(str));
},

emscripten_console_trace: (str) => {
#if ASSERTIONS
assert(typeof str == 'number');
#endif
console.trace(UTF8ToString(str));
},
emscripten_console_log: (str) => console.log(UTF8ToString(str)),
emscripten_console_warn: (str) => console.warn(UTF8ToString(str)),
emscripten_console_error: (str) => console.error(UTF8ToString(str)),
emscripten_console_trace: (str) => console.trace(UTF8ToString(str)),

emscripten_throw_number: (number) => {
throw number;
},

emscripten_throw_string: (str) => {
#if ASSERTIONS
assert(typeof str == 'number');
#endif
throw UTF8ToString(str);
},

Expand Down Expand Up @@ -2185,7 +2159,7 @@ addToLibrary({

$alignMemory: (size, alignment) => {
#if ASSERTIONS
assert(alignment, "alignment argument is required");
assert(alignment, 'alignment argument is required');
#endif
return Math.ceil(size / alignment) * alignment;
},
Expand Down
2 changes: 1 addition & 1 deletion test/codesize/hello_world_wasm.expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ WebAssembly.instantiate(d.wasm, {
for (var b = a, l = e, m = b + void 0; l[b] && !(b >= m); ) ++b;
a = f.decode(e.subarray(a, b));
} else a = "";
k.call(c, a);
return k.call(c, a);
}
}
}).then((a => {
Expand Down
2 changes: 1 addition & 1 deletion test/codesize/hello_world_wasm2js.expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function e(a) {
for (var n = a, c = g, f = n + void 0; c[n] && !(n >= f); ) ++n;
a = h.decode(g.subarray(a, n));
} else a = "";
u.call(q, a);
return u.call(q, a);
}
}
}).then((a => {
Expand Down
4 changes: 2 additions & 2 deletions test/codesize/test_codesize_hello_dylink_all.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"a.out.js": 267889,
"a.out.js": 267881,
"a.out.nodebug.wasm": 587151,
"total": 855040,
"total": 855032,
"sent": [
"IMG_Init",
"IMG_Load",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.html": 548,
"a.html.gz": 371,
"a.js": 287,
"a.js.gz": 242,
"a.js": 294,
"a.js.gz": 247,
"a.wasm": 95,
"a.wasm.gz": 101,
"total": 930,
"total_gz": 714
"total": 937,
"total_gz": 719
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"a.html": 319,
"a.html.gz": 243,
"a.js": 965,
"a.js.gz": 588,
"total": 1284,
"total_gz": 831
"a.js": 972,
"a.js.gz": 590,
"total": 1291,
"total_gz": 833
}
Loading