Skip to content

Commit

Permalink
Use string interpolation in src/runtime_debug.js. NFC (emscripten-cor…
Browse files Browse the repository at this point in the history
  • Loading branch information
sbc100 authored Nov 7, 2023
1 parent 01be543 commit c634e50
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/runtime_debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
});
Expand All @@ -62,15 +62,15 @@ 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.
var librarySymbol = 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';
}
Expand All @@ -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';
}
Expand All @@ -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);
Expand Down

0 comments on commit c634e50

Please sign in to comment.