diff --git a/src/runtime_debug.js b/src/runtime_debug.js index 33d0e1c632ed..0ade98dba7a6 100644 --- a/src/runtime_debug.js +++ b/src/runtime_debug.js @@ -45,7 +45,7 @@ function missingGlobal(sym, msg) { Object.defineProperty(globalThis, sym, { configurable: true, get() { - warnOnce('`' + sym + '` is not longer defined by emscripten. ' + msg); + warnOnce(`\`${sym}\` is not longer defined by emscripten. ${msg}`); return undefined; } }); @@ -62,7 +62,7 @@ function missingLibrarySymbol(sym) { get() { // Can't `abort()` here because it would break code that does runtime // checks. e.g. `if (typeof SDL === 'undefined')`. - var msg = '`' + sym + '` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line'; + var msg = `\`${sym}\` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line`; // DEFAULT_LIBRARY_FUNCS_TO_INCLUDE requires the name as it appears in // library.js, which means $name for a JS name with no prefix, or name // for a JS name like _name. @@ -70,7 +70,7 @@ function missingLibrarySymbol(sym) { if (!librarySymbol.startsWith('_')) { librarySymbol = '$' + sym; } - msg += " (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='" + librarySymbol + "')"; + msg += ` (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='${librarySymbol}')`; if (isExportedByForceFilesystem(sym)) { msg += '. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'; } @@ -89,7 +89,7 @@ function unexportedRuntimeSymbol(sym) { Object.defineProperty(Module, sym, { configurable: true, get() { - var msg = "'" + sym + "' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)"; + var msg = `'${sym}' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)`; if (isExportedByForceFilesystem(sym)) { msg += '. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'; } @@ -114,9 +114,9 @@ var MIN_INT53 = - (2 ** (53 - 1)) + 1; var MIN_INT64 = - (2 ** (64 - 1)) + 1; function checkInt(value, bits, min, max) { - assert(Number.isInteger(Number(value)), "attempt to write non-integer (" + value + ") into integer heap"); - assert(value <= max, "value (" + value + ") too large to write as " + bits +"-bit value"); - assert(value >= min, "value (" + value + ") too small to write as " + bits +"-bit value"); + assert(Number.isInteger(Number(value)), `attempt to write non-integer (${value}) into integer heap`); + assert(value <= max, `value (${value}) too large to write as ${bits}-bit value`); + assert(value >= min, `value (${value}) too small to write as ${bits}-bit value`); } var checkInt1 = (value) => checkInt(value, 1, 1);