Skip to content

Commit 3bc02ca

Browse files
committed
Remove redundant assertion from emscripten_console_* functions. NFC
The UTF8ToString functions that these all call has this assertion already and with a useful message.
1 parent 71d627a commit 3bc02ca

1 file changed

Lines changed: 5 additions & 31 deletions

File tree

src/lib/libcore.js

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1967,42 +1967,16 @@ addToLibrary({
19671967
_emscripten_get_progname__deps: ['$getExecutableName', '$stringToUTF8'],
19681968
_emscripten_get_progname: (str, len) => stringToUTF8(getExecutableName(), str, len),
19691969

1970-
emscripten_console_log: (str) => {
1971-
#if ASSERTIONS
1972-
assert(typeof str == 'number');
1973-
#endif
1974-
console.log(UTF8ToString(str));
1975-
},
1976-
1977-
emscripten_console_warn: (str) => {
1978-
#if ASSERTIONS
1979-
assert(typeof str == 'number');
1980-
#endif
1981-
console.warn(UTF8ToString(str));
1982-
},
1983-
1984-
emscripten_console_error: (str) => {
1985-
#if ASSERTIONS
1986-
assert(typeof str == 'number');
1987-
#endif
1988-
console.error(UTF8ToString(str));
1989-
},
1990-
1991-
emscripten_console_trace: (str) => {
1992-
#if ASSERTIONS
1993-
assert(typeof str == 'number');
1994-
#endif
1995-
console.trace(UTF8ToString(str));
1996-
},
1970+
emscripten_console_log: (str) => console.log(UTF8ToString(str)),
1971+
emscripten_console_warn: (str) => console.warn(UTF8ToString(str)),
1972+
emscripten_console_error: (str) => console.error(UTF8ToString(str)),
1973+
emscripten_console_trace: (str) => console.trace(UTF8ToString(str)),
19971974

19981975
emscripten_throw_number: (number) => {
19991976
throw number;
20001977
},
20011978

20021979
emscripten_throw_string: (str) => {
2003-
#if ASSERTIONS
2004-
assert(typeof str == 'number');
2005-
#endif
20061980
throw UTF8ToString(str);
20071981
},
20081982

@@ -2185,7 +2159,7 @@ addToLibrary({
21852159

21862160
$alignMemory: (size, alignment) => {
21872161
#if ASSERTIONS
2188-
assert(alignment, "alignment argument is required");
2162+
assert(alignment, 'alignment argument is required');
21892163
#endif
21902164
return Math.ceil(size / alignment) * alignment;
21912165
},

0 commit comments

Comments
 (0)