Skip to content

Commit c634e50

Browse files
authored
Use string interpolation in src/runtime_debug.js. NFC (#20629)
1 parent 01be543 commit c634e50

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/runtime_debug.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function missingGlobal(sym, msg) {
4545
Object.defineProperty(globalThis, sym, {
4646
configurable: true,
4747
get() {
48-
warnOnce('`' + sym + '` is not longer defined by emscripten. ' + msg);
48+
warnOnce(`\`${sym}\` is not longer defined by emscripten. ${msg}`);
4949
return undefined;
5050
}
5151
});
@@ -62,15 +62,15 @@ function missingLibrarySymbol(sym) {
6262
get() {
6363
// Can't `abort()` here because it would break code that does runtime
6464
// checks. e.g. `if (typeof SDL === 'undefined')`.
65-
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';
65+
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`;
6666
// DEFAULT_LIBRARY_FUNCS_TO_INCLUDE requires the name as it appears in
6767
// library.js, which means $name for a JS name with no prefix, or name
6868
// for a JS name like _name.
6969
var librarySymbol = sym;
7070
if (!librarySymbol.startsWith('_')) {
7171
librarySymbol = '$' + sym;
7272
}
73-
msg += " (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='" + librarySymbol + "')";
73+
msg += ` (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='${librarySymbol}')`;
7474
if (isExportedByForceFilesystem(sym)) {
7575
msg += '. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you';
7676
}
@@ -89,7 +89,7 @@ function unexportedRuntimeSymbol(sym) {
8989
Object.defineProperty(Module, sym, {
9090
configurable: true,
9191
get() {
92-
var msg = "'" + sym + "' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)";
92+
var msg = `'${sym}' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)`;
9393
if (isExportedByForceFilesystem(sym)) {
9494
msg += '. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you';
9595
}
@@ -114,9 +114,9 @@ var MIN_INT53 = - (2 ** (53 - 1)) + 1;
114114
var MIN_INT64 = - (2 ** (64 - 1)) + 1;
115115

116116
function checkInt(value, bits, min, max) {
117-
assert(Number.isInteger(Number(value)), "attempt to write non-integer (" + value + ") into integer heap");
118-
assert(value <= max, "value (" + value + ") too large to write as " + bits +"-bit value");
119-
assert(value >= min, "value (" + value + ") too small to write as " + bits +"-bit value");
117+
assert(Number.isInteger(Number(value)), `attempt to write non-integer (${value}) into integer heap`);
118+
assert(value <= max, `value (${value}) too large to write as ${bits}-bit value`);
119+
assert(value >= min, `value (${value}) too small to write as ${bits}-bit value`);
120120
}
121121

122122
var checkInt1 = (value) => checkInt(value, 1, 1);

0 commit comments

Comments
 (0)