Skip to content
Merged
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
47 changes: 10 additions & 37 deletions src/lib/libcore.js
Original file line number Diff line number Diff line change
Expand Up @@ -1967,44 +1967,17 @@ 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));
},
// These single-line arrow functions use curly braces since otherwise closure
// compiler will inject a extra `return` keyword when inlining.
// https://github.com/emscripten-core/emscripten/issues/26922
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_console_error: (str) => {
#if ASSERTIONS
assert(typeof str == 'number');
#endif
console.error(UTF8ToString(str));
},
emscripten_throw_number: (number) => { throw number; },

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

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

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

#if !MINIMAL_RUNTIME
#if STACK_OVERFLOW_CHECK
Expand Down Expand Up @@ -2185,7 +2158,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
Loading