msecs.
Cpu Profiler [?] Halt Profile WebGL Trace Calls slower than
msecs.
${helpText}`;
document.getElementById('trace_limit').onkeydown = (e) => {
if (e.which == 13 || e.keycode == 13) {
emscriptenCpuProfiler.enableTraceWebGL();
@@ -434,8 +434,8 @@ var emscriptenCpuProfiler = {
var overlayHeight = fpsOverlay.getBoundingClientRect().height || fpsOverlay.height;
fpsOverlay.height = overlayHeight; // Remember the overlay height when it was visible, if it is hidden.
fpsOverlay.style.display = (rect.bottom >= overlayHeight) ? 'block' : 'none';
- fpsOverlay.style.top = Math.max(rect.top, 0) + 'px';
- fpsOverlay.style.left = Math.max(rect.left, 0) + 'px';
+ fpsOverlay.style.top = `${Math.max(rect.top, 0)}px`;
+ fpsOverlay.style.left = `${Math.max(rect.left, 0)}px`;
}
setTimeout(positionOverlay, 100);
setInterval(positionOverlay, 5000);
@@ -521,7 +521,7 @@ var emscriptenCpuProfiler = {
if (sect.frametimesInsideMainLoop.length > this.canvas.width) sect.frametimesInsideMainLoop.length = this.canvas.width;
if (sect.frametimesOutsideMainLoop.length > this.canvas.width) sect.frametimesOutsideMainLoop.length = this.canvas.width;
}
- document.getElementById('ntotalframes').innerHTML = this.canvas.width + '';
+ document.getElementById('ntotalframes').innerHTML = `${this.canvas.width}`;
this.clearUi(0, this.canvas.width);
this.drawGraphLabels();
startX = 0; // Full redraw all columns.
@@ -587,7 +587,7 @@ var emscriptenCpuProfiler = {
if (l9.includes(f)) return 9;
if (l10.includes(f)) return 10;
if (l11.includes(f)) return 11;
- console.warn('Unexpected WebGL function ' + f);
+ console.warn(`Unexpected WebGL function ${f}`);
},
detectWebGLContext() {
@@ -630,7 +630,7 @@ var emscriptenCpuProfiler = {
for (var f in glCtx) {
if (typeof glCtx[f] != 'function' || f.startsWith('real_')) continue;
- var realf = 'real_' + f;
+ var realf = `real_${f}`;
glCtx[f] = glCtx[realf];
delete glCtx[realf];
}
@@ -638,7 +638,7 @@ var emscriptenCpuProfiler = {
hookWebGLFunction(f, glCtx) {
var section = (this.hotGLFunctions.includes(f) || f.startsWith('uniform') || f.startsWith('vertexAttrib')) ? 0 : 1;
- var realf = 'real_' + f;
+ var realf = `real_${f}`;
glCtx[realf] = glCtx[f];
var numArgs = this.webGLFunctionLength(f); // On Firefox & Chrome, could do "glCtx[realf].length", but that doesn't work on Edge, which always reports 0.
// Accessing 'arguments'/'...' is super slow, so to avoid overhead, statically reason the number of arguments.
@@ -655,7 +655,7 @@ var emscriptenCpuProfiler = {
case 9: glCtx[f] = (a1, a2, a3, a4, a5, a6, a7, a8, a9) => { this.enterSection(section); var ret = glCtx[realf](a1, a2, a3, a4, a5, a6, a7, a8, a9); this.endSection(section); return ret; }; break;
case 10: glCtx[f] = (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) => { this.enterSection(section); var ret = glCtx[realf](a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); this.endSection(section); return ret; }; break;
case 11: glCtx[f] = (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) => { this.enterSection(section); var ret = glCtx[realf](a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); this.endSection(section); return ret; }; break;
- default: throw new Error('hookWebGL failed! Unexpected length ' + glCtx[realf].length);
+ default: throw new Error(`hookWebGL failed! Unexpected length ${glCtx[realf].length}`);
}
},
@@ -712,7 +712,7 @@ var emscriptenCpuProfiler = {
matrixFuncs.forEach(f => {
glCtx[f] = (a1, a2, a3, a4, a5) => {
// WebGL2 version has 2 extra optional parameters, ensure we forward them
- var ret = (a4 !== undefined) ? glCtx['real_' + f](a1, a2, a3, a4, a5) : glCtx['real_' + f](a1, a2, a3);
+ var ret = (a4 !== undefined) ? glCtx[`real_${f}`](a1, a2, a3, a4, a5) : glCtx[`real_${f}`](a1, a2, a3);
return ret;
}
});
@@ -720,7 +720,7 @@ var emscriptenCpuProfiler = {
ndvFuncs.forEach(f => {
glCtx[f] = (a1, a2, a3, a4) => {
// WebGL2 version has 1 extra parameter, ensure we forward them
- var ret = (a4 !== undefined) ? glCtx['real_' + f](a1, a2, a3, a4) : glCtx['real_' + f](a1, a2, a3);
+ var ret = (a4 !== undefined) ? glCtx[`real_${f}`](a1, a2, a3, a4) : glCtx[`real_${f}`](a1, a2, a3);
return ret;
}
});
diff --git a/src/emrun_postjs.js b/src/emrun_postjs.js
index 9f43926aeeb77..b65273c4f599e 100644
--- a/src/emrun_postjs.js
+++ b/src/emrun_postjs.js
@@ -44,7 +44,7 @@ if (globalThis.window && globalThis.document && (typeof ENVIRONMENT_IS_PTHREAD =
http.onreadystatechange = () => {
if (http.readyState == 4 /*DONE*/) {
if (--emrun_num_post_messages_in_flight == 0 && emrun_should_close_itself) {
- postExit('^exit^'+EXITSTATUS);
+ postExit(`^exit^${EXITSTATUS}`);
}
}
}
@@ -60,17 +60,17 @@ if (globalThis.window && globalThis.document && (typeof ENVIRONMENT_IS_PTHREAD =
var prevErr = err;
addOnExit(() => {
if (emrun_num_post_messages_in_flight == 0) {
- postExit('^exit^'+EXITSTATUS);
+ postExit(`^exit^${EXITSTATUS}`);
} else {
emrun_should_close_itself = true;
}
});
out = (text) => {
- post('stdio.html', '^out^'+(emrun_http_sequence_number++)+'^'+encodeURIComponent(text));
+ post('stdio.html', `^out^${emrun_http_sequence_number++}^${encodeURIComponent(text)}`);
prevPrint(text);
};
err = (text) => {
- post('stdio.html', '^err^'+(emrun_http_sequence_number++)+'^'+encodeURIComponent(text));
+ post('stdio.html', `^err^${emrun_http_sequence_number++}^${encodeURIComponent(text)}`);
prevErr(text);
};
emrun_file_dump = (filename, data) => {
@@ -78,7 +78,7 @@ if (globalThis.window && globalThis.document && (typeof ENVIRONMENT_IS_PTHREAD =
if (ArrayBuffer.isView(data) && typeof SharedArrayBuffer !== "undefined" && data.buffer instanceof SharedArrayBuffer) {
data = new data.constructor(data); // Make a clone of the typed array of the same type, since http.send() does not allow SharedArrayBuffer backing.
}
- post("stdio.html?file=" + filename, data);
+ post(`stdio.html?file=${filename}`, data);
};
// Notify emrun web server that this browser has successfully launched the
diff --git a/src/gl-matrix.js b/src/gl-matrix.js
index 68980fb827310..5779825fe0bea 100644
--- a/src/gl-matrix.js
+++ b/src/gl-matrix.js
@@ -402,7 +402,7 @@ vec3.unproject = function (vec, view, proj, viewport, dest) {
* _returns {string} String representation of vec
*/
vec3.str = function (vec) {
- return '[' + vec[0] + ', ' + vec[1] + ', ' + vec[2] + ']';
+ return `[${vec[0]}, ${vec[1]}, ${vec[2]}]`;
};
/*
@@ -1927,7 +1927,7 @@ quat4.slerp = function (quat, quat2, slerp, dest) {
* _returns {string} String representation of quat
*/
quat4.str = function (quat) {
- return '[' + quat[0] + ', ' + quat[1] + ', ' + quat[2] + ', ' + quat[3] + ']';
+ return `[${quat[0]}, ${quat[1]}, ${quat[2]}, ${quat[3]}]`;
};
diff --git a/src/jsifier.mjs b/src/jsifier.mjs
index 36cfe5f4f03bd..dadaac71e2777 100644
--- a/src/jsifier.mjs
+++ b/src/jsifier.mjs
@@ -61,7 +61,7 @@ function mangleCSymbolName(f) {
if (f === '__main_argc_argv') {
f = 'main';
}
- return f[0] == '$' ? f.slice(1) : '_' + f;
+ return f[0] == '$' ? f.slice(1) : `_${f}`;
}
// Splits out items that pass filter. Returns also the original sans the filtered
@@ -73,8 +73,8 @@ function splitter(array, filter) {
function escapeJSONKey(x) {
if (/^[\d\w_]+$/.exec(x) || x[0] === '"' || x[0] === "'") return x;
- assert(!x.includes("'"), 'cannot have internal single quotes in keys: ' + x);
- return "'" + x + "'";
+ assert(!x.includes("'"), `cannot have internal single quotes in keys: ${x}`);
+ return `'${x}'`;
}
// JSON.stringify will completely omit function objects. This function is
@@ -83,7 +83,7 @@ function stringifyWithFunctions(obj) {
if (typeof obj == 'function') return obj.toString();
if (obj === null || typeof obj != 'object') return JSON.stringify(obj);
if (Array.isArray(obj)) {
- return '[' + obj.map(stringifyWithFunctions).join(',') + ']';
+ return `[${obj.map(stringifyWithFunctions).join(',')}]`;
}
// preserve the type of the object if it is one of [Map, Set, WeakMap, WeakSet].
@@ -103,13 +103,13 @@ function stringifyWithFunctions(obj) {
var str = stringifyWithFunctions(value);
// Handle JS method syntax where the function property starts with its own
// name. e.g. `foo(a) {}` (or `async foo(a) {}`)
- if (typeof value === 'function' && (str.startsWith(key) || str.startsWith('async ' + key))) {
- rtn += str + ',\n';
+ if (typeof value === 'function' && (str.startsWith(key) || str.startsWith(`async ${key}`))) {
+ rtn += `${str},\n`;
} else {
rtn += `${escapeJSONKey(key)}:${str},\n`;
}
}
- return rtn + '}';
+ return `${rtn}}`;
}
function isDefined(symName) {
@@ -135,7 +135,7 @@ function getTransitiveDeps(symbol) {
while (toVisit.length) {
const sym = toVisit.pop();
if (!seen.has(sym)) {
- let directDeps = LibraryManager.library[sym + '__deps'] ?? [];
+ let directDeps = LibraryManager.library[`${sym}__deps`] ?? [];
directDeps = directDeps.filter((d) => typeof d === 'string');
for (const dep of directDeps) {
if (!transitiveDeps.has(dep)) {
@@ -251,8 +251,8 @@ function addImplicitDeps(snippet, deps) {
'setValue',
];
for (const dep of autoDeps) {
- if (snippet.includes(dep + '(')) {
- deps.push('$' + dep);
+ if (snippet.includes(`${dep}(`)) {
+ deps.push(`$${dep}`);
}
}
// If the snippet contains eval(), it may dynamically evaluate code loaded from memory at runtime
@@ -272,7 +272,7 @@ function addImplicitDeps(snippet, deps) {
];
for (const heap of heapDeps) {
if (snippet.includes(heap)) {
- deps.push('$' + heap);
+ deps.push(`$${heap}`);
}
}
}
@@ -364,7 +364,7 @@ return ${makeReturn64(await_ + body)};
${async_}function(${args}) {
${argConversions}
var ret = (${orig_async_}() => { ${body} })();
-return ${makeReturn64(await_ + 'ret')};
+return ${makeReturn64(`${await_}ret`)};
}`;
}
@@ -432,7 +432,7 @@ export async function runJSify(outputFile, symbolsOnly) {
str = str.replaceAll('EMSCRIPTEN$IMPORT$META', 'import.meta');
}
- await outputHandle.write(str + '\n');
+ await outputHandle.write(`${str}\n`);
}
const symbolsNeeded = DEFAULT_LIBRARY_FUNCS_TO_INCLUDE;
@@ -446,8 +446,8 @@ export async function runJSify(outputFile, symbolsOnly) {
addImplicitDeps(snippet, symbolsNeeded);
}
for (const sym of EXPORTED_RUNTIME_METHODS) {
- if ('$' + sym in LibraryManager.library) {
- symbolsNeeded.push('$' + sym);
+ if (`$${sym}` in LibraryManager.library) {
+ symbolsNeeded.push(`$${sym}`);
}
}
@@ -470,7 +470,7 @@ export async function runJSify(outputFile, symbolsOnly) {
// Is this a shorthand `foo() {}` method syntax?
// If so, prepend a function keyword so that it's valid syntax when extracted.
if (snippet.startsWith(symbol)) {
- snippet = 'function ' + snippet;
+ snippet = `function ${snippet}`;
}
if (isStub) {
@@ -496,10 +496,10 @@ function(${args}) {
});
}
- const sig = LibraryManager.library[symbol + '__sig'];
- const isAsyncFunction = ASYNCIFY && LibraryManager.library[symbol + '__async'];
+ const sig = LibraryManager.library[`${symbol}__sig`];
+ const isAsyncFunction = ASYNCIFY && LibraryManager.library[`${symbol}__async`];
- const i53abi = LibraryManager.library[symbol + '__i53abi'];
+ const i53abi = LibraryManager.library[`${symbol}__i53abi`];
if (i53abi) {
if (!sig) {
error(`JS library error: '__i53abi' decorator requires '__sig' decorator: '${symbol}'`);
@@ -516,7 +516,7 @@ function(${args}) {
compileTimeContext.i53ConversionDeps.forEach((d) => deps.push(d));
}
- const proxyingMode = LibraryManager.library[symbol + '__proxy'];
+ const proxyingMode = LibraryManager.library[`${symbol}__proxy`];
if (ASYNCIFY && isAsyncFunction == 'auto') {
snippet = handleAsyncFunction(snippet, sig, proxyingMode == 'sync');
@@ -534,7 +534,7 @@ function(${args}) {
}
let proxyMode = PROXY_ASYNC;
if (proxyingMode === 'sync') {
- const isAsyncFunction = LibraryManager.library[symbol + '__async'];
+ const isAsyncFunction = LibraryManager.library[`${symbol}__async`];
if (isAsyncFunction) {
proxyMode = PROXY_SYNC_ASYNC;
} else {
@@ -544,7 +544,7 @@ function(${args}) {
const rtnType = sig?.[0];
const proxyFunc =
MEMORY64 && rtnType == 'p' ? 'proxyToMainThreadPtr' : 'proxyToMainThread';
- deps.push('$' + proxyFunc);
+ deps.push(`$${proxyFunc}`);
return `
${async_}function(${args}) {
if (ENVIRONMENT_IS_PTHREAD)
@@ -609,8 +609,8 @@ function(${args}) {
}
addedLibraryItems[symbol] = true;
- const deps = LibraryManager.library[symbol + '__deps'] ??= [];
- let sig = LibraryManager.library[symbol + '__sig'];
+ const deps = LibraryManager.library[`${symbol}__deps`] ??= [];
+ let sig = LibraryManager.library[`${symbol}__sig`];
if (!WASM_BIGINT && sig && sig[0] == 'j') {
// Without WASM_BIGINT functions that return i64 depend on setTempRet0
// to return the upper 32-bits of the result.
@@ -618,7 +618,7 @@ function(${args}) {
deps.push('setTempRet0');
}
- const isAsyncFunction = LibraryManager.library[symbol + '__async'];
+ const isAsyncFunction = LibraryManager.library[`${symbol}__async`];
if (ASYNCIFY && isAsyncFunction) {
asyncFuncs.push(symbol);
}
@@ -652,7 +652,7 @@ function(${args}) {
if (symbol === '__main_argc_argv') {
undefinedSym = 'main/__main_argc_argv';
}
- let msg = 'undefined symbol: ' + undefinedSym;
+ let msg = `undefined symbol: ${undefinedSym}`;
if (dependent) msg += ` (referenced by ${dependent})`;
if (ERROR_ON_UNDEFINED_SYMBOLS) {
error(msg);
@@ -689,7 +689,7 @@ function(${args}) {
if (ASSERTIONS) {
assertion += `if (!${target} || ${target}.stub) abort("external symbol '${symbol}' is missing. perhaps a side module was not linked in? if this function was expected to arrive from a system library, try to build the MAIN_MODULE with EMCC_FORCE_STDLIBS=1 in the environment");\n`;
}
- stubFunctionBody = assertion + `return ${target}(...args);`;
+ stubFunctionBody = `${assertion}return ${target}(...args);`;
}
isStub = true;
LibraryManager.library[symbol] = new Function('...args', stubFunctionBody);
@@ -697,16 +697,16 @@ function(${args}) {
librarySymbols.push(mangled);
- if (!isStub && LibraryManager.library[symbol + '__export']) {
+ if (!isStub && LibraryManager.library[`${symbol}__export`]) {
extraExports.add(mangled);
}
const original = LibraryManager.library[symbol];
let snippet = original;
- const isUserSymbol = LibraryManager.library[symbol + '__user'];
+ const isUserSymbol = LibraryManager.library[`${symbol}__user`];
// Check for dependencies on `__internal` symbols from user libraries.
for (const dep of deps) {
- if (isUserSymbol && LibraryManager.library[dep + '__internal']) {
+ if (isUserSymbol && LibraryManager.library[`${dep}__internal`]) {
warn(`user library symbol '${symbol}' depends on internal symbol '${dep}'`);
}
}
@@ -714,7 +714,7 @@ function(${args}) {
let isFunction = typeof snippet == 'function';
let isNativeAlias = false;
- const postsetId = symbol + '__postset';
+ const postsetId = `${symbol}__postset`;
const postset = LibraryManager.library[postsetId];
if (postset) {
// A postset is either code to run right now, or some text we should emit.
@@ -722,7 +722,7 @@ function(${args}) {
const postsetString = typeof postset == 'function' ? postset() : postset;
if (postsetString && !addedLibraryItems[postsetId]) {
addedLibraryItems[postsetId] = true;
- postSets.push(postsetString + ';');
+ postSets.push(`${postsetString};`);
}
}
@@ -745,7 +745,7 @@ function(${args}) {
// it's target) we need to construct a forwarding function from
// one to the other.
const isSigRelevant = MAIN_MODULE || MEMORY64 || CAN_ADDRESS_2GB || sig?.includes('j');
- const targetSig = LibraryManager.library[aliasTarget + '__sig'];
+ const targetSig = LibraryManager.library[`${aliasTarget}__sig`];
if (isSigRelevant && sig && targetSig && sig != targetSig) {
debugLog(`${symbol}: Alias target (${aliasTarget}) has different signature (${sig} vs ${targetSig})`)
isFunction = true;
@@ -785,7 +785,7 @@ function(${args}) {
let contentText;
if (isFunction) {
// Emit the body of a JS library function.
- if ((USE_ASAN || USE_LSAN) && LibraryManager.library[symbol + '__noleakcheck']) {
+ if ((USE_ASAN || USE_LSAN) && LibraryManager.library[`${symbol}__noleakcheck`]) {
contentText = modifyJSFunction(
snippet,
(args, body) => `(${args}) => noLeakCheck(() => {${body}})`,
@@ -799,7 +799,7 @@ function(${args}) {
// modifyJSFunction which could have changed or removed the name.
if (contentText.match(/^\s*([^}]*)\s*=>/s)) {
// Handle arrow functions
- contentText = `var ${mangled} = ` + contentText + ';';
+ contentText = `var ${mangled} = ${contentText};`;
} else if (contentText.startsWith('class ')) {
// Handle class declarations (which also have typeof == 'function'.)
contentText = contentText.replace(/^class(?:\s+(?!extends\b)[^{\s]+)?/, `class ${mangled}`);
@@ -812,7 +812,7 @@ function(${args}) {
// foo: ';[code here verbatim]'
// emits
// 'var foo;[code here verbatim];'
- contentText = 'var ' + mangled + snippet;
+ contentText = `var ${mangled}${snippet}`;
if (snippet[snippet.length - 1] != ';' && snippet[snippet.length - 1] != '}') {
contentText += ';';
}
@@ -840,7 +840,7 @@ function(${args}) {
if (contentText && MODULARIZE == 'instance' && (EXPORT_ALL || EXPORTED_FUNCTIONS.has(mangled) || extraExports.has(mangled)) && !isStub) {
// In MODULARIZE=instance mode mark JS library symbols are exported at
// the point of declaration.
- contentText = 'export ' + contentText;
+ contentText = `export ${contentText}`;
}
// Dynamic linking needs signatures to create proper wrappers.
@@ -863,10 +863,10 @@ function(${args}) {
// Add the docs if they exist and if we are actually emitting a declaration.
// See the TODO about wasmTable above.
- let docs = LibraryManager.library[symbol + '__docs'];
+ let docs = LibraryManager.library[`${symbol}__docs`];
let commentText = '';
if (contentText != '' && docs) {
- commentText += docs + '\n';
+ commentText += `${docs}\n`;
}
if (EMIT_TSD) {
@@ -877,10 +877,10 @@ function(${args}) {
}
const depsText = deps
- ? deps
+ ? `${deps
.map(addDependency)
.filter((x) => x != '')
- .join('\n') + '\n'
+ .join('\n')}\n`
: '';
return depsText + commentText + contentText;
}
diff --git a/src/lib/libaddfunction.js b/src/lib/libaddfunction.js
index 30d07de694277..2f002005c0dc3 100644
--- a/src/lib/libaddfunction.js
+++ b/src/lib/libaddfunction.js
@@ -189,7 +189,7 @@ addToLibrary({
throw err;
}
#if ASSERTIONS
- assert(typeof sig != 'undefined', 'Missing signature argument to addFunction: ' + func);
+ assert(typeof sig != 'undefined', `Missing signature argument to addFunction: ${func}`);
#endif
var wrapped = convertJsFunctionToWasm(func, sig);
setWasmTableEntry(ret, wrapped);
diff --git a/src/lib/libautodebug.js b/src/lib/libautodebug.js
index 435e8a24be7e6..8c40b53e3db31 100644
--- a/src/lib/libautodebug.js
+++ b/src/lib/libautodebug.js
@@ -10,132 +10,132 @@
#endif
const LibraryAutodebug = {
- $log_execution: (loc) => dbg('log_execution ' + loc),
+ $log_execution: (loc) => dbg(`log_execution ${loc}`),
$get_i32: (loc, index, value) => {
- dbg('get_i32 ' + [loc, index, value]);
+ dbg(`get_i32 ${[loc, index, value]}`);
return value;
},
$get_i64__deps: ['setTempRet0'],
$get_i64: (loc, index, low, high) => {
- dbg('get_i64 ' + [loc, index, low, high]);
+ dbg(`get_i64 ${[loc, index, low, high]}`);
_setTempRet0(high);
return low;
},
$get_f32: (loc, index, value) => {
- dbg('get_f32 ' + [loc, index, value]);
+ dbg(`get_f32 ${[loc, index, value]}`);
return value;
},
$get_f64: (loc, index, value) => {
- dbg('get_f64 ' + [loc, index, value]);
+ dbg(`get_f64 ${[loc, index, value]}`);
return value;
},
$get_funcref: (loc, index, value) => {
- dbg('get_funcref ' + [loc, index, value]);
+ dbg(`get_funcref ${[loc, index, value]}`);
return value;
},
$get_externref: (loc, index, value) => {
- dbg('get_externref ' + [loc, index, value]);
+ dbg(`get_externref ${[loc, index, value]}`);
return value;
},
$get_anyref: (loc, index, value) => {
- dbg('get_anyref ' + [loc, index, value]);
+ dbg(`get_anyref ${[loc, index, value]}`);
return value;
},
$get_exnref: (loc, index, value) => {
- dbg('get_exnref ' + [loc, index, value]);
+ dbg(`get_exnref ${[loc, index, value]}`);
return value;
},
$set_i32: (loc, index, value) => {
- dbg('set_i32 ' + [loc, index, value]);
+ dbg(`set_i32 ${[loc, index, value]}`);
return value;
},
$set_i64__deps: ['setTempRet0'],
$set_i64: (loc, index, low, high) => {
- dbg('set_i64 ' + [loc, index, low, high]);
+ dbg(`set_i64 ${[loc, index, low, high]}`);
_setTempRet0(high);
return low;
},
$set_f32: (loc, index, value) => {
- dbg('set_f32 ' + [loc, index, value]);
+ dbg(`set_f32 ${[loc, index, value]}`);
return value;
},
$set_f64: (loc, index, value) => {
- dbg('set_f64 ' + [loc, index, value]);
+ dbg(`set_f64 ${[loc, index, value]}`);
return value;
},
$set_funcref: (loc, index, value) => {
- dbg('set_funcref ' + [loc, index, value]);
+ dbg(`set_funcref ${[loc, index, value]}`);
return value;
},
$set_externref: (loc, index, value) => {
- dbg('set_externref ' + [loc, index, value]);
+ dbg(`set_externref ${[loc, index, value]}`);
return value;
},
$set_anyref: (loc, index, value) => {
- dbg('set_anyref ' + [loc, index, value]);
+ dbg(`set_anyref ${[loc, index, value]}`);
return value;
},
$set_exnref: (loc, index, value) => {
- dbg('set_exnref ' + [loc, index, value]);
+ dbg(`set_exnref ${[loc, index, value]}`);
return value;
},
$load_ptr: (loc, bytes, offset, ptr) => {
- dbg('load_ptr ' + [loc, bytes, offset, ptr]);
+ dbg(`load_ptr ${[loc, bytes, offset, ptr]}`);
return ptr;
},
$load_val_i32: (loc, value) => {
- dbg('load_val_i32 ' + [loc, value]);
+ dbg(`load_val_i32 ${[loc, value]}`);
return value;
},
$load_val_i64__deps: ['setTempRet0'],
$load_val_i64: (loc, low, high) => {
- dbg('load_val_i64 ' + [loc, low, high]);
+ dbg(`load_val_i64 ${[loc, low, high]}`);
_setTempRet0(high);
return low;
},
$load_val_f32: (loc, value) => {
- dbg('load_val_f32 ' + [loc, value]);
+ dbg(`load_val_f32 ${[loc, value]}`);
return value;
},
$load_val_f64: (loc, value) => {
- dbg('load_val_f64 ' + [loc, value]);
+ dbg(`load_val_f64 ${[loc, value]}`);
return value;
},
$store_ptr: (loc, bytes, offset, ptr) => {
- dbg('store_ptr ' + [loc, bytes, offset, ptr]);
+ dbg(`store_ptr ${[loc, bytes, offset, ptr]}`);
return ptr;
},
$store_val_i32: (loc, value) => {
- dbg('store_val_i32 ' + [loc, value]);
+ dbg(`store_val_i32 ${[loc, value]}`);
return value;
},
$store_val_i64__deps: ['setTempRet0'],
$store_val_i64: (loc, low, high) => {
- dbg('store_val_i64 ' + [loc, low, high]);
+ dbg(`store_val_i64 ${[loc, low, high]}`);
_setTempRet0(high);
return low;
},
$store_val_f32: (loc, value) => {
- dbg('store_val_f32 ' + [loc, value]);
+ dbg(`store_val_f32 ${[loc, value]}`);
return value;
},
$store_val_f64: (loc, value) => {
- dbg('store_val_f64 ' + [loc, value]);
+ dbg(`store_val_f64 ${[loc, value]}`);
return value;
},
$memory_grow_pre: (loc, delta) => {
- dbg('memory_grow_pre ' + [loc, delta]);
+ dbg(`memory_grow_pre ${[loc, delta]}`);
return delta;
},
$memory_grow_post: (loc, result) => {
- dbg('memory_grow_post ' + [loc, result]);
+ dbg(`memory_grow_post ${[loc, result]}`);
return result;
},
};
for (const symbol of Object.keys(LibraryAutodebug)) {
if (!isDecorator(symbol)) {
- LibraryAutodebug[symbol + '__force'] = true;
+ LibraryAutodebug[`${symbol}__force`] = true;
}
}
diff --git a/src/lib/libbrowser.js b/src/lib/libbrowser.js
index 7e37cf96593d3..2cd5a559cd364 100644
--- a/src/lib/libbrowser.js
+++ b/src/lib/libbrowser.js
@@ -125,7 +125,7 @@ var LibraryBrowser = {
}
return ret;
}
- audio.src = 'data:audio/x-' + name.slice(-3) + ';base64,' + encode64(byteArray);
+ audio.src = `data:audio/x-${name.slice(-3)};base64,${encode64(byteArray)}`;
finish(audio); // we don't wait for confirmation this worked - but it's worth trying
};
audio.src = url;
@@ -359,11 +359,11 @@ var LibraryBrowser = {
delta *= 80;
break;
default:
- abort('unrecognized mouse wheel delta mode: ' + event.deltaMode);
+ abort(`unrecognized mouse wheel delta mode: ${event.deltaMode}`);
}
break;
default:
- abort('unrecognized mouse wheel event: ' + event.type);
+ abort(`unrecognized mouse wheel event: ${event.type}`);
}
return delta;
},
@@ -512,8 +512,8 @@ var LibraryBrowser = {
if (canvas.height != hNative) canvas.height = hNative;
if (typeof canvas.style != 'undefined') {
if (w != wNative || h != hNative) {
- canvas.style.setProperty( 'width', w + 'px', 'important');
- canvas.style.setProperty('height', h + 'px', 'important');
+ canvas.style.setProperty( 'width', `${w}px`, 'important');
+ canvas.style.setProperty('height', `${h}px`, 'important');
} else {
canvas.style.removeProperty( 'width');
canvas.style.removeProperty('height');
diff --git a/src/lib/libccall.js b/src/lib/libccall.js
index 492f8a74343ee..2a10d2001970c 100644
--- a/src/lib/libccall.js
+++ b/src/lib/libccall.js
@@ -11,7 +11,7 @@ addToLibrary({
#endif
$getCFunc__internal: true,
$getCFunc: (ident) => {
- var func = Module['_' + ident]; // closure exported function
+ var func = Module[`_${ident}`]; // closure exported function
#if ASSERTIONS
assert(func, `Cannot call unknown function ${ident}, make sure it is exported`);
#endif
diff --git a/src/lib/libcore.js b/src/lib/libcore.js
index cd6f66dee51fe..94a498b69f09a 100644
--- a/src/lib/libcore.js
+++ b/src/lib/libcore.js
@@ -87,7 +87,7 @@ addToLibrary({
// Convert to 32-bit unsigned value
ptr >>>= 0;
#endif
- return '0x' + ptr.toString(16).padStart({{{ POINTER_SIZE * 2 }}}, '0');
+ return `0x${ptr.toString(16).padStart({{{ POINTER_SIZE * 2 }}}, '0')}`;
},
$zeroMemory: (ptr, size) => HEAPU8.fill(0, ptr, ptr + size),
@@ -437,7 +437,7 @@ addToLibrary({
// ==========================================================================
__assert_fail: (condition, filename, line, func) =>
- abort(`Assertion failed: ${UTF8ToString(condition)}, at: ` + [filename ? UTF8ToString(filename) : 'unknown filename', line, func ? UTF8ToString(func) : 'unknown function']),
+ abort(`Assertion failed: ${UTF8ToString(condition)}, at: ${[filename ? UTF8ToString(filename) : 'unknown filename', line, func ? UTF8ToString(func) : 'unknown function']}`),
#endif
#if STACK_OVERFLOW_CHECK >= 2
@@ -667,7 +667,7 @@ addToLibrary({
return (b[0] | (b[1] << 8) | (b[2] << 16) | (b[3] << 24)) >>> 0;
},
$inetNtop4: (addr) =>
- (addr & 0xff) + '.' + ((addr >> 8) & 0xff) + '.' + ((addr >> 16) & 0xff) + '.' + ((addr >> 24) & 0xff),
+ `${addr & 0xff}.${(addr >> 8) & 0xff}.${(addr >> 16) & 0xff}.${(addr >> 24) & 0xff}`,
$inetPton6__deps: ['htons'],
$inetPton6: (str) => {
var words;
@@ -982,7 +982,7 @@ addToLibrary({
assert(id < 65535, 'exceeded max address mappings of 65535');
#endif
- addr = '172.29.' + (id & 0xff) + '.' + (id & 0xff00);
+ addr = `172.29.${id & 0xff}.${id & 0xff00}`;
DNS.address_map.names[addr] = name;
DNS.address_map.addrs[name] = addr;
@@ -1208,7 +1208,7 @@ addToLibrary({
}
if (serv && servlen) {
- port = '' + port;
+ port = `${port}`;
var numBytesWrittenExclNull = stringToUTF8(port, serv, servlen);
if (numBytesWrittenExclNull+1 >= servlen) {
@@ -1489,7 +1489,7 @@ addToLibrary({
if (!warnOnce.shown[text]) {
warnOnce.shown[text] = 1;
#if ENVIRONMENT_MAY_BE_NODE
- if (ENVIRONMENT_IS_NODE) text = 'warning: ' + text;
+ if (ENVIRONMENT_IS_NODE) text = `warning: ${text}`;
#endif
err(text);
}
@@ -1549,7 +1549,7 @@ addToLibrary({
emscripten_print_double__deps: ['$stringToUTF8', '$lengthBytesUTF8'],
emscripten_print_double: (x, to, max) => {
- var str = x + '';
+ var str = `${x}`;
if (to) return stringToUTF8(str, to, max);
else return lengthBytesUTF8(str);
},
@@ -1992,7 +1992,7 @@ addToLibrary({
emscripten_dbgn: (str, len) => dbg(UTF8ToString(str, len)),
emscripten_dbg_backtrace: (str) => {
- dbg(UTF8ToString(str) + '\n' + new Error().stack);
+ dbg(`${UTF8ToString(str)}\n${new Error().stack}`);
},
#endif
@@ -2184,9 +2184,9 @@ addToLibrary({
x = 'main';
}
#if DYNCALLS
- return x.startsWith('dynCall_') ? x : '_' + x;
+ return x.startsWith('dynCall_') ? x : `_${x}`;
#else
- return '_' + x;
+ return `_${x}`;
#endif
},
diff --git a/src/lib/libembind_gen.js b/src/lib/libembind_gen.js
index 132e8deeff214..a51594bf39293 100644
--- a/src/lib/libembind_gen.js
+++ b/src/lib/libembind_gen.js
@@ -79,7 +79,7 @@ var LibraryEmbind = {
let argName;
if (arg.type instanceof OptionalType && !seenNonOptional) {
argType = nameMap(arg.type.type);
- argName = arg.name + '?';
+ argName = `${arg.name}?`;
} else {
seenNonOptional = true;
argType = nameMap(arg.type);
@@ -548,7 +548,7 @@ var LibraryEmbind = {
thisType = argTypes[1].classType;
}
if (!(thisType instanceof ClassDefinition)) {
- throw new Error('This type must be class definition for: ' + name);
+ throw new Error(`This type must be class definition for: ${name}`);
}
argStart = 2;
}
@@ -926,7 +926,7 @@ var LibraryEmbind = {
#endif
const output = printer.print();
var fs = require('node:fs');
- fs.writeFileSync(process.argv[2], output + '\n');
+ fs.writeFileSync(process.argv[2], `${output}\n`);
},
// Stub functions used by eval, but not needed for TS generation:
diff --git a/src/lib/libembind_shared.js b/src/lib/libembind_shared.js
index 7bda2c575430d..e2255186784e7 100644
--- a/src/lib/libembind_shared.js
+++ b/src/lib/libembind_shared.js
@@ -260,7 +260,7 @@ var LibraryEmbindShared = {
args1.push(argName);
}
- invokerFnBody += (returns || isAsync ? 'var rv = ' : '') + `invoker(${argsListWired});\n`;
+ invokerFnBody += `${returns || isAsync ? 'var rv = ' : ''}invoker(${argsListWired});\n`;
var returnVal = returns ? 'rv' : '';
#if ASYNCIFY == 1
@@ -299,7 +299,7 @@ var LibraryEmbindShared = {
invokerFnBody += `return Asyncify.currData ? Asyncify.whenDone().then(onDone) : onDone(${returnVal});\n`
#elif ASYNCIFY == 2
invokerFnBody += '}\n';
- invokerFnBody += 'return ' + (isAsync ? 'rv.then(onDone)' : `onDone(${returnVal})`) + ';';
+ invokerFnBody += `return ${isAsync ? 'rv.then(onDone)' : `onDone(${returnVal})`};`;
#endif
invokerFnBody += '}\n';
diff --git a/src/lib/libexceptions_stub.js b/src/lib/libexceptions_stub.js
index 8feb95f1c1860..f093a88dc71e8 100644
--- a/src/lib/libexceptions_stub.js
+++ b/src/lib/libexceptions_stub.js
@@ -23,7 +23,7 @@ var LibraryExceptions = {};
LibraryExceptions[name] = () => abort();
#if !INCLUDE_FULL_LIBRARY
// This method of link-time error generation is not compatible with INCLUDE_FULL_LIBRARY
- LibraryExceptions[name + '__deps'] = [() => {
+ LibraryExceptions[`${name}__deps`] = [() => {
error(`DISABLE_EXCEPTION_THROWING was set (likely due to -fno-exceptions), which means no C++ exception throwing support code is linked in, but such support is required by symbol '${name}'. Either do not set DISABLE_EXCEPTION_THROWING (if you do want exception throwing) or compile all source files with -fno-exceptions (so that no exceptions support code is required); also make sure DISABLE_EXCEPTION_CATCHING is set to the right value - if you want exceptions, it should be off, and vice versa.`);
}];
#endif
diff --git a/src/lib/libfs.js b/src/lib/libfs.js
index 4907180698353..ec7dfb4613fe0 100644
--- a/src/lib/libfs.js
+++ b/src/lib/libfs.js
@@ -231,7 +231,7 @@ FS.staticInit();`;
opts.follow_mount ??= true
if (!PATH.isAbs(path)) {
- path = FS.cwd() + '/' + path;
+ path = `${FS.cwd()}/${path}`;
}
// limit max consecutive symlinks to SYMLOOP_MAX.
@@ -257,7 +257,7 @@ FS.staticInit();`;
if (parts[i] === '..') {
current_path = PATH.dirname(current_path);
if (FS.isRoot(current)) {
- path = current_path + '/' + parts.slice(i + 1).join('/');
+ path = `${current_path}/${parts.slice(i + 1).join('/')}`;
// We're making progress here, don't let many consecutive ..'s
// lead to ELOOP
nlinks--;
@@ -294,9 +294,9 @@ FS.staticInit();`;
}
var link = current.node_ops.readlink(current);
if (!PATH.isAbs(link)) {
- link = PATH.dirname(current_path) + '/' + link;
+ link = `${PATH.dirname(current_path)}/${link}`;
}
- path = link + '/' + parts.slice(i + 1).join('/');
+ path = `${link}/${parts.slice(i + 1).join('/')}`;
continue linkloop;
}
}
diff --git a/src/lib/libglew.js b/src/lib/libglew.js
index f054ae9b2b158..73b332c888d96 100644
--- a/src/lib/libglew.js
+++ b/src/lib/libglew.js
@@ -106,7 +106,7 @@ var LibraryGLEW = {
// extensions from GLEmulations do not come unprefixed
// so, try with prefix
- return (GLEW.extensions.includes('GL_' + name));
+ return (GLEW.extensions.includes(`GL_${name}`));
},
},
diff --git a/src/lib/libglfw.js b/src/lib/libglfw.js
index b03a4561cc158..561d1c772a969 100644
--- a/src/lib/libglfw.js
+++ b/src/lib/libglfw.js
@@ -1538,7 +1538,7 @@ var LibraryGLFW = {
// extensions from GLEmulations do not come unprefixed
// so, try with prefix
- return (GLFW.extensions.includes('GL_' + extension));
+ return (GLFW.extensions.includes(`GL_${extension}`));
},
glfwSwapInterval__deps: ['emscripten_set_main_loop_timing'],
diff --git a/src/lib/libglut.js b/src/lib/libglut.js
index a4b6e98513ea9..b243142f9db3a 100644
--- a/src/lib/libglut.js
+++ b/src/lib/libglut.js
@@ -561,7 +561,7 @@ var LibraryGLUT = {
cursorStyle = 'none';
break;
default:
- abort('glutSetCursor: Unknown cursor type: ' + cursor);
+ abort(`glutSetCursor: Unknown cursor type: ${cursor}`);
}
Browser.getCanvas().style.cursor = cursorStyle;
},
diff --git a/src/lib/libhtml5.js b/src/lib/libhtml5.js
index 135074b31c3dd..5db7a0470fe34 100644
--- a/src/lib/libhtml5.js
+++ b/src/lib/libhtml5.js
@@ -1166,8 +1166,8 @@ var LibraryHTML5 = {
document.body.style.backgroundColor ||= 'black'; // IE11
// Firefox always shows black letterboxes independent of style color.
- target.style.width = cssWidth + 'px';
- target.style.height = cssHeight + 'px';
+ target.style.width = `${cssWidth}px`;
+ target.style.height = `${cssHeight}px`;
if (strategy.filteringMode == {{{ cDefs.EMSCRIPTEN_FULLSCREEN_FILTERING_NEAREST }}}) {
target.style.imageRendering = 'optimizeSpeed';
@@ -1285,8 +1285,8 @@ var LibraryHTML5 = {
// Add letterboxes to a fullscreen element in a cross-browser way.
$setLetterbox: (element, topBottom, leftRight) => {
// Cannot use margin to specify letterboxes in FF or Chrome, since those ignore margins in fullscreen mode.
- element.style.paddingLeft = element.style.paddingRight = leftRight + 'px';
- element.style.paddingTop = element.style.paddingBottom = topBottom + 'px';
+ element.style.paddingLeft = element.style.paddingRight = `${leftRight}px`;
+ element.style.paddingTop = element.style.paddingBottom = `${topBottom}px`;
},
$currentFullscreenStrategy: 0,
@@ -1336,8 +1336,8 @@ var LibraryHTML5 = {
var b = (innerWidth - jstoi_q(canvas.style.width)) / 2;
setLetterbox(canvas, t, b);
} else {
- canvas.style.width = w + 'px';
- canvas.style.height = h + 'px';
+ canvas.style.width = `${w}px`;
+ canvas.style.height = `${h}px`;
var b = (innerWidth - w) / 2;
setLetterbox(canvas, topMargin, b);
}
@@ -2313,8 +2313,8 @@ var LibraryHTML5 = {
#endif
if (!target) return {{{ cDefs.EMSCRIPTEN_RESULT_UNKNOWN_TARGET }}};
- target.style.width = width + 'px';
- target.style.height = height + 'px';
+ target.style.width = `${width}px`;
+ target.style.height = `${height}px`;
return {{{ cDefs.EMSCRIPTEN_RESULT_SUCCESS }}};
},
diff --git a/src/lib/libopenal.js b/src/lib/libopenal.js
index d3132671e4824..f4fd3561b200a 100644
--- a/src/lib/libopenal.js
+++ b/src/lib/libopenal.js
@@ -2369,7 +2369,7 @@ var LibraryOpenAL = {
break;
case 0x1005 /* ALC_DEVICE_SPECIFIER */:
if (globalThis.AudioContext) {
- ret = AL.DEVICE_NAME + '\0';
+ ret = `${AL.DEVICE_NAME}\0`;
} else {
ret = '\0';
}
@@ -2379,7 +2379,7 @@ var LibraryOpenAL = {
break;
case 0x310 /* ALC_CAPTURE_DEVICE_SPECIFIER */:
if (!deviceId) {
- ret = AL.CAPTURE_DEVICE_NAME + '\0';
+ ret = `${AL.CAPTURE_DEVICE_NAME}\0`;
} else {
var c = AL.requireValidCaptureDevice(deviceId, 'alcGetString');
if (!c) {
diff --git a/src/lib/libpath.js b/src/lib/libpath.js
index 1905aae0bf1af..94ddba8814ff3 100644
--- a/src/lib/libpath.js
+++ b/src/lib/libpath.js
@@ -67,7 +67,7 @@ addToLibrary({
// rather than the empty string.
basename: (path) => path && path.match(/([^\/]+|\/)\/*$/)[1],
join: (...paths) => PATH.normalize(paths.join('/')),
- join2: (l, r) => PATH.normalize(l + '/' + r),
+ join2: (l, r) => PATH.normalize(`${l}/${r}`),
},
// The FS-using parts are split out into a separate object, so simple path
// usage does not require the FS.
@@ -92,7 +92,7 @@ addToLibrary({
} else if (!path) {
return ''; // an invalid portion invalidates the whole thing
}
- resolvedPath = path + '/' + resolvedPath;
+ resolvedPath = `${path}/${resolvedPath}`;
resolvedAbsolute = PATH.isAbs(path);
}
// At this point the path should be resolved to a full absolute path, but
diff --git a/src/lib/libpipefs.js b/src/lib/libpipefs.js
index 5285f05f26fcc..aeff1cc93f5f9 100644
--- a/src/lib/libpipefs.js
+++ b/src/lib/libpipefs.js
@@ -299,7 +299,7 @@ addToLibrary({
if (!PIPEFS.nextname.current) {
PIPEFS.nextname.current = 0;
}
- return 'pipe[' + (PIPEFS.nextname.current++) + ']';
+ return `pipe[${PIPEFS.nextname.current++}]`;
},
},
});
diff --git a/src/lib/libsdl.js b/src/lib/libsdl.js
index a0e5e63f33e92..92b27b7af7cc2 100644
--- a/src/lib/libsdl.js
+++ b/src/lib/libsdl.js
@@ -334,18 +334,18 @@ var LibrarySDL = {
// Load SDL color into a CSS-style color specification
loadColorToCSSRGB(color) {
var rgba = {{{ makeGetValue('color', 0, 'i32') }}};
- return 'rgb(' + (rgba&255) + ',' + ((rgba >> 8)&255) + ',' + ((rgba >> 16)&255) + ')';
+ return `rgb(${rgba & 255},${(rgba >> 8) & 255},${(rgba >> 16) & 255})`;
},
loadColorToCSSRGBA(color) {
var rgba = {{{ makeGetValue('color', 0, 'i32') }}};
- return 'rgba(' + (rgba&255) + ',' + ((rgba >> 8)&255) + ',' + ((rgba >> 16)&255) + ',' + (((rgba >> 24)&255)/255) + ')';
+ return `rgba(${rgba & 255},${(rgba >> 8) & 255},${(rgba >> 16) & 255},${((rgba >> 24) & 255) / 255})`;
},
translateColorToCSSRGBA: (rgba) =>
- 'rgba(' + (rgba&0xff) + ',' + (rgba>>8 & 0xff) + ',' + (rgba>>16 & 0xff) + ',' + (rgba>>>24)/0xff + ')',
+ `rgba(${rgba & 0xff},${rgba >> 8 & 0xff},${rgba >> 16 & 0xff},${(rgba >>> 24) / 0xff})`,
translateRGBAToCSSRGBA: (r, g, b, a) =>
- 'rgba(' + (r&0xff) + ',' + (g&0xff) + ',' + (b&0xff) + ',' + (a&0xff)/255 + ')',
+ `rgba(${r & 0xff},${g & 0xff},${b & 0xff},${(a & 0xff) / 255})`,
translateRGBAToColor: (r, g, b, a) => r | g << 8 | b << 16 | a << 24,
@@ -1063,7 +1063,7 @@ var LibrarySDL = {
// BTW, quote all font names is easier than searching spaces
fontName = `"${fontName}"`;
}
- return height + 'px ' + fontName + ', serif';
+ return `${height}px ${fontName}, serif`;
},
estimateTextWidth(fontData, text) {
@@ -1229,12 +1229,12 @@ var LibrarySDL = {
#if ASSERTIONS
debugSurface(surfData) {
- dbg('dumping surface ' + [surfData.surf, surfData.source, surfData.width, surfData.height]);
+ dbg(`dumping surface ${[surfData.surf, surfData.source, surfData.width, surfData.height]}`);
var image = surfData.ctx.getImageData(0, 0, surfData.width, surfData.height);
var data = image.data;
var num = Math.min(surfData.width, surfData.height);
for (var i = 0; i < num; i++) {
- dbg(' diagonal ' + i + ':' + [data[i*surfData.width*4 + i*4 + 0], data[i*surfData.width*4 + i*4 + 1], data[i*surfData.width*4 + i*4 + 2], data[i*surfData.width*4 + i*4 + 3]]);
+ dbg(` diagonal ${i}:${[data[i * surfData.width * 4 + i * 4 + 0], data[i * surfData.width * 4 + i * 4 + 1], data[i * surfData.width * 4 + i * 4 + 2], data[i * surfData.width * 4 + i * 4 + 3]]}`);
}
},
#endif
@@ -1604,7 +1604,7 @@ var LibrarySDL = {
var data = surfData.image.data;
var buffer = surfData.buffer;
#if ASSERTIONS
- assert(buffer % 4 == 0, 'Invalid buffer offset: ' + buffer);
+ assert(buffer % 4 == 0, `Invalid buffer offset: ${buffer}`);
#endif
var src = {{{ getHeapOffset('buffer', 'i32') }}};
var dst = 0;
@@ -1856,7 +1856,7 @@ var LibrarySDL = {
}
var oldData = SDL.surfaces[surf];
- var ret = SDL.makeSurface(oldData.width, oldData.height, oldData.flags, false, 'copy:' + oldData.source);
+ var ret = SDL.makeSurface(oldData.width, oldData.height, oldData.flags, false, `copy:${oldData.source}`);
var newData = SDL.surfaces[ret];
newData.ctx.globalCompositeOperation = 'copy';
@@ -2037,7 +2037,7 @@ var LibrarySDL = {
}
return retrievedEventCount;
}
- default: abort('SDL_PeepEvents does not yet support that action: ' + action);
+ default: abort(`SDL_PeepEvents does not yet support that action: ${action}`);
}
},
@@ -2190,7 +2190,7 @@ var LibrarySDL = {
var x = stackAlloc({{{ getNativeTypeSize('i32') }}});
var y = stackAlloc({{{ getNativeTypeSize('i32') }}});
var comp = stackAlloc({{{ getNativeTypeSize('i32') }}});
- var data = Module['_' + func](...params, x, y, comp, 0);
+ var data = Module[`_${func}`](...params, x, y, comp, 0);
if (!data) return null;
addCleanup(() => Module['_stbi_image_free'](data));
return {
@@ -2244,7 +2244,7 @@ var LibrarySDL = {
#endif
}
- var surf = SDL.makeSurface(raw.width, raw.height, 0, false, 'load:' + filename);
+ var surf = SDL.makeSurface(raw.width, raw.height, 0, false, `load:${filename}`);
var surfData = SDL.surfaces[surf];
surfData.ctx.globalCompositeOperation = 'copy';
if (!raw.rawData) {
@@ -2720,7 +2720,7 @@ var LibrarySDL = {
#if expectToReceiveOnModule('freePreloadedMediaOnUse')
if (raw === null) err('Trying to reuse preloaded audio, but freePreloadedMediaOnUse is set!');
#endif
- if (!Module['noAudioDecoding']) warnOnce('Cannot find preloaded audio ' + filename);
+ if (!Module['noAudioDecoding']) warnOnce(`Cannot find preloaded audio ${filename}`);
// see if we can read the file-contents from the in-memory FS
try {
@@ -3144,7 +3144,7 @@ var LibrarySDL = {
var h = fontData.size;
color = SDL.loadColorToCSSRGB(color); // XXX alpha breaks fonts?
var fontString = SDL.makeFontString(h, fontData.name);
- var surf = SDL.makeSurface(w, h, 0, false, 'text:' + text); // bogus numbers..
+ var surf = SDL.makeSurface(w, h, 0, false, `text:${text}`); // bogus numbers..
var surfData = SDL.surfaces[surf];
surfData.ctx.save();
surfData.ctx.fillStyle = color;
@@ -3236,8 +3236,8 @@ var LibrarySDL = {
var w = Math.abs(x2 - x1);
var h = Math.abs(y2 - y1);
surfData.ctx.save();
- surfData.ctx[action + 'Style'] = cssColor;
- surfData.ctx[action + 'Rect'](x, y, w, h);
+ surfData.ctx[`${action}Style`] = cssColor;
+ surfData.ctx[`${action}Rect`](x, y, w, h);
surfData.ctx.restore();
},
drawLine: (surf, x1, y1, x2, y2, cssColor) => {
@@ -3276,7 +3276,7 @@ var LibrarySDL = {
surfData.ctx.restore();
surfData.ctx.save();
- surfData.ctx[action + 'Style'] = cssColor;
+ surfData.ctx[`${action}Style`] = cssColor;
surfData.ctx[action]();
surfData.ctx.restore();
},
diff --git a/src/lib/libsockfs.js b/src/lib/libsockfs.js
index 07e39ef5afc3d..7f255d7ef2221 100644
--- a/src/lib/libsockfs.js
+++ b/src/lib/libsockfs.js
@@ -258,7 +258,7 @@ addToLibrary({
if (url === 'ws://' || url === 'wss://') { // Is the supplied URL config just a prefix, if so complete it.
var parts = addr.split('/');
- url = url + parts[0] + ':' + port + '/' + parts.slice(1).join('/');
+ url = `${url + parts[0]}:${port}/${parts.slice(1).join('/')}`;
}
if (subProtocols !== 'null') {
@@ -323,13 +323,13 @@ addToLibrary({
return peer;
},
getPeer(sock, addr, port) {
- return sock.peers[addr + ':' + port];
+ return sock.peers[`${addr}:${port}`];
},
addPeer(sock, peer) {
- sock.peers[peer.addr + ':' + peer.port] = peer;
+ sock.peers[`${peer.addr}:${peer.port}`] = peer;
},
removePeer(sock, peer) {
- delete sock.peers[peer.addr + ':' + peer.port];
+ delete sock.peers[`${peer.addr}:${peer.port}`];
},
handlePeerEvents(sock, peer) {
var first = true;
diff --git a/src/lib/libstack_trace.js b/src/lib/libstack_trace.js
index fa4f8d107a7c3..fca0492571226 100644
--- a/src/lib/libstack_trace.js
+++ b/src/lib/libstack_trace.js
@@ -56,7 +56,7 @@ var LibraryStackTrace = {
} else {
// Was not able to extract this line for demangling/sourcemapping
// purposes. Output it as-is.
- callstack += line + '\n';
+ callstack += `${line}\n`;
continue;
}
}
diff --git a/src/lib/libsyscall.js b/src/lib/libsyscall.js
index 57e6652b81238..8e7f63c50edb5 100644
--- a/src/lib/libsyscall.js
+++ b/src/lib/libsyscall.js
@@ -35,7 +35,7 @@ var SyscallsLibrary = {
}
return dir;
}
- return dir + '/' + path;
+ return `${dir}/${path}`;
},
writeStat(buf, stat) {
@@ -642,7 +642,7 @@ var SyscallsLibrary = {
#endif
var count = doPollSync(fds, nfds);
#if ASSERTIONS
- if (!count && timeout != 0) warnOnce('non-zero poll() timeout not supported: ' + timeout)
+ if (!count && timeout != 0) warnOnce(`non-zero poll() timeout not supported: ${timeout}`)
#endif
return count;
},
diff --git a/src/lib/libtime.js b/src/lib/libtime.js
index d3870f861e9c5..a6adb6cebc8b9 100644
--- a/src/lib/libtime.js
+++ b/src/lib/libtime.js
@@ -281,7 +281,7 @@ addToLibrary({
// TODO: not sure we really need to escape all of these in JS regexps
var SPECIAL_CHARS = '\\!@#$^&*()+=-[]/{}|:<>?,.';
for (var i=0, ii=SPECIAL_CHARS.length; i
{
if (!getEnvStrings.strings) {
// Default values.
- var lang = (globalThis.navigator?.language ?? 'C').replace('-', '_') + '.UTF-8';
+ var lang = `${(globalThis.navigator?.language ?? 'C').replace('-', '_')}.UTF-8`;
var env = {
#if !PURE_WASI
'USER': 'web_user',
diff --git a/src/lib/libwebgl.js b/src/lib/libwebgl.js
index 069e6ae4996d2..6eadc633dc16e 100644
--- a/src/lib/libwebgl.js
+++ b/src/lib/libwebgl.js
@@ -1279,7 +1279,7 @@ for (/**@suppress{duplicate}*/var i = 0; i <= {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
$webglGetExtensions: () => {
var exts = getEmscriptenSupportedExtensions(GLctx);
#if GL_EXTENSIONS_IN_PREFIXED_FORMAT
- exts = exts.concat(exts.map((e) => 'GL_' + e));
+ exts = exts.concat(exts.map((e) => `GL_${e}`));
#endif
return exts;
},
@@ -1340,7 +1340,7 @@ for (/**@suppress{duplicate}*/var i = 0; i <= {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
var ver_re = /^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/;
var ver_num = glslVersion.match(ver_re);
if (ver_num !== null) {
- if (ver_num[1].length == 3) ver_num[1] = ver_num[1] + '0'; // ensure minor version has 2 digits
+ if (ver_num[1].length == 3) ver_num[1] = `${ver_num[1]}0`; // ensure minor version has 2 digits
glslVersion = `OpenGL ES GLSL ES ${ver_num[1]} (${glslVersion})`;
}
ret = stringToNewUTF8(glslVersion);
diff --git a/src/modules.mjs b/src/modules.mjs
index 210305178484d..f9139a1f43495 100644
--- a/src/modules.mjs
+++ b/src/modules.mjs
@@ -304,7 +304,7 @@ export const LibraryManager = {
}
}
for (const [key, value] of Object.entries(aliases)) {
- (this.library[key + '__deps'] ??= []).push(value);
+ (this.library[`${key}__deps`] ??= []).push(value);
}
},
@@ -313,7 +313,7 @@ export const LibraryManager = {
set(target, prop, value) {
target[prop] = value;
if (!isDecorator(prop)) {
- target[prop + '__user'] = true;
+ target[`${prop}__user`] = true;
}
return true;
},
@@ -432,7 +432,7 @@ function cDefine(key) {
}
function isInternalSymbol(ident) {
- return ident + '__internal' in LibraryManager.library;
+ return `${ident}__internal` in LibraryManager.library;
}
function getUnusedLibrarySymbols() {
@@ -547,7 +547,7 @@ function exportRuntimeSymbols() {
// Note that this assertion may be hit when a function is moved into the
// JS library. In that case the function should be removed from the list
// of runtime elements above.
- assert(!runtimeElementsSet.has(jsname), 'runtimeElements contains library symbol: ' + ident);
+ assert(!runtimeElementsSet.has(jsname), `runtimeElements contains library symbol: ${ident}`);
runtimeElements.push(jsname);
}
}
@@ -565,7 +565,7 @@ function exportRuntimeSymbols() {
if (MODULARIZE == 'instance') {
if (results.length == 0) return '';
- return '// Runtime exports\nexport { ' + results.join(', ') + ' };\n';
+ return `// Runtime exports\nexport { ${results.join(', ')} };\n`;
}
if (ASSERTIONS && !EXPORT_ALL) {
@@ -601,7 +601,7 @@ function exportRuntimeSymbols() {
results.unshift('// Begin runtime exports');
results.push('// End runtime exports');
- return results.join('\n ') + '\n';
+ return `${results.join('\n ')}\n`;
}
function exportLibrarySymbols() {
@@ -613,14 +613,14 @@ function exportLibrarySymbols() {
}
}
results.push('// End JS library exports');
- return results.join('\n ') + '\n';
+ return `${results.join('\n ')}\n`;
}
function exportJSSymbols() {
// In MODULARIZE=instance mode JS library symbols are marked with `export`
// at the point of declaration.
if (MODULARIZE == 'instance') return exportRuntimeSymbols();
- return exportRuntimeSymbols() + ' ' + exportLibrarySymbols();
+ return `${exportRuntimeSymbols()} ${exportLibrarySymbols()}`;
}
addToCompileTimeContext({
diff --git a/src/parseTools.mjs b/src/parseTools.mjs
index e4acfc1a4e360..fd0c5cdf28cd9 100644
--- a/src/parseTools.mjs
+++ b/src/parseTools.mjs
@@ -139,7 +139,7 @@ export function preprocess(filename) {
}
if (inStyle) {
if (showCurrentLine()) {
- ret += line + '\n';
+ ret += `${line}\n`;
}
continue;
}
@@ -220,7 +220,7 @@ export function preprocess(filename) {
if (emptyLine && !line) {
continue;
}
- ret += line + '\n';
+ ret += `${line}\n`;
if (!line) {
emptyLine = true;
} else {
@@ -324,7 +324,7 @@ function splitI64(value) {
// For negatives, we need to ensure a -1 if the value is overall negative,
// even if not significant negative component
- const low = value + '>>>0';
+ const low = `${value}>>>0`;
// prettier-ignore
const high = makeInlineCalculation(
asmCoercion('Math.abs(VALUE)', 'double') + ' >= ' + asmEnsureFloat('1', 'double') + ' ? ' +
@@ -431,8 +431,8 @@ function ensureDot(value) {
// (0.001 will turn into 1e-3, which has no .)
if (value.includes('.') || /[IN]/.test(value)) return value;
const e = value.indexOf('e');
- if (e < 0) return value + '.0';
- return value.slice(0, e) + '.0' + value.slice(e);
+ if (e < 0) return `${value}.0`;
+ return `${value.slice(0, e)}.0${value.slice(e)}`;
}
export function isNumber(x) {
@@ -988,7 +988,7 @@ function makeRemovedFSAssert(fsName) {
// Given an array of elements [elem1,elem2,elem3], returns a string "['elem1','elem2','elem3']"
function buildStringArray(array) {
if (array.length > 0) {
- return "['" + array.join("','") + "']";
+ return `['${array.join("','")}']`;
} else {
return '[]';
}
@@ -1164,7 +1164,7 @@ function ENVIRONMENT_IS_WORKER_THREAD() {
var envs = [];
if (PTHREADS) envs.push('ENVIRONMENT_IS_PTHREAD');
if (WASM_WORKERS) envs.push('ENVIRONMENT_IS_WASM_WORKER');
- return '(' + envs.join('||') + ')';
+ return `(${envs.join('||')})`;
}
function nodeDetectionCode() {
diff --git a/src/postamble.js b/src/postamble.js
index a474aa57280f3..f0e6654913e53 100644
--- a/src/postamble.js
+++ b/src/postamble.js
@@ -215,7 +215,7 @@ function checkUnflushedContent() {
#if '$FS' in addedLibraryItems && '$TTY' in addedLibraryItems
// also flush in the JS FS layer
for (var name of ['stdout', 'stderr']) {
- var info = FS.analyzePath('/dev/' + name);
+ var info = FS.analyzePath(`/dev/${name}`);
if (!info) return;
var stream = info.object;
var rdev = stream.rdev;
diff --git a/src/preamble.js b/src/preamble.js
index 7585eaef04c2a..8c7b39728ffed 100644
--- a/src/preamble.js
+++ b/src/preamble.js
@@ -73,7 +73,7 @@ var EXITSTATUS;
function assert(condition, text) {
if (!condition) {
#if ASSERTIONS
- abort('Assertion failed' + (text ? ': ' + text : ''));
+ abort(`Assertion failed${text ? `: ${text}` : ''}`);
#else
// This build was created without ASSERTIONS defined. `assert()` should not
// ever be called in this configuration but in case there are callers in
diff --git a/src/runtime_debug.js b/src/runtime_debug.js
index 79f2f132aef3e..c6ac6a1c8e3d2 100644
--- a/src/runtime_debug.js
+++ b/src/runtime_debug.js
@@ -24,7 +24,7 @@ function dbg(...args) {
}
return a;
}
- fs.writeSync(2, args.map(stringify).join(' ') + '\n');
+ fs.writeSync(2, `${args.map(stringify).join(' ')}\n`);
} else
#endif
// TODO(sbc): Make this configurable somehow. Its not always convenient for
@@ -146,7 +146,7 @@ function missingLibrarySymbol(sym) {
// for a JS name like _name.
var librarySymbol = sym;
if (!librarySymbol.startsWith('_')) {
- librarySymbol = '$' + sym;
+ librarySymbol = `$${sym}`;
}
msg += ` (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='${librarySymbol}')`;
if (isExportedByForceFilesystem(sym)) {
@@ -267,10 +267,10 @@ function prettyPrint(arg) {
var index = printObjectList.indexOf(arg);
if (index >= 0) return `<${arg}|${index}>`;
if (arg.toString() == '[object HTMLImageElement]') {
- return arg + '\n\n';
+ return `${arg}\n\n`;
}
if (arg.byteLength) {
- return '{' + Array.prototype.slice.call(arg, 0, Math.min(arg.length, 400)) + '}';
+ return `{${Array.prototype.slice.call(arg, 0, Math.min(arg.length, 400))}}`;
}
if (typeof arg == 'function') {
return '';
diff --git a/src/runtime_stack_check.js b/src/runtime_stack_check.js
index bd38501044ee2..4d98ead6b8877 100644
--- a/src/runtime_stack_check.js
+++ b/src/runtime_stack_check.js
@@ -38,7 +38,7 @@ function writeStackCookie() {
}
function u32ToHexString(num) {
- return '0x' + (num >>> 0).toString(16).padStart(8, '0');
+ return `0x${(num >>> 0).toString(16).padStart(8, '0')}`;
}
function checkStackCookie() {
diff --git a/src/shell.js b/src/shell.js
index ad4fd53554e63..26ca474523023 100644
--- a/src/shell.js
+++ b/src/shell.js
@@ -204,7 +204,7 @@ if (ENVIRONMENT_IS_NODE) {
scriptDirectory = require('node:path').dirname(require('node:url').fileURLToPath(_scriptName)) + '/';
}
#else
- scriptDirectory = __dirname + '/';
+ scriptDirectory = `${__dirname}/`;
#endif
#include "node_shell_read.js"
diff --git a/src/utility.mjs b/src/utility.mjs
index da84f2c694623..b1cf18324da70 100644
--- a/src/utility.mjs
+++ b/src/utility.mjs
@@ -24,7 +24,7 @@ export function dump(item) {
funcData = item.funcData;
item.funcData = null;
}
- return '// ' + JSON.stringify(item, null, ' ').replace(/\n/g, '\n// ');
+ return `// ${JSON.stringify(item, null, ' ').replace(/\n/g, '\n// ')}`;
} catch {
const ret = [];
for (const [i, j] of Object.entries(item)) {
@@ -113,7 +113,7 @@ export function mergeInto(obj, other, options = null) {
// check if sig is missing for added functions
if (options.checkSig) {
for (const [key, value] of Object.entries(other)) {
- if (typeof value === 'function' && !other.hasOwnProperty(key + '__sig')) {
+ if (typeof value === 'function' && !other.hasOwnProperty(`${key}__sig`)) {
error(`__sig is missing for function: ${key}. Do not use checkSig if this is intended`);
return;
}
@@ -274,7 +274,7 @@ class Profiler {
log(msg) {
const depth = this.ids.length;
const indent = ' '.repeat(depth)
- printErr('[prof] ' + indent + msg);
+ printErr(`[prof] ${indent}${msg}`);
}
start(id) {
diff --git a/src/web_or_worker_shell_read.js b/src/web_or_worker_shell_read.js
index e24d858c4f1df..b2bf56de2d82a 100644
--- a/src/web_or_worker_shell_read.js
+++ b/src/web_or_worker_shell_read.js
@@ -45,5 +45,5 @@
if (response.ok) {
return response.arrayBuffer();
}
- throw new Error(response.status + ' : ' + response.url);
+ throw new Error(`${response.status} : ${response.url}`);
};
diff --git a/test/codesize/test_codesize_cxx_ctors1.json b/test/codesize/test_codesize_cxx_ctors1.json
index 0757dcd5099d3..ee378e183006a 100644
--- a/test/codesize/test_codesize_cxx_ctors1.json
+++ b/test/codesize/test_codesize_cxx_ctors1.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 19198,
- "a.out.js.gz": 8107,
+ "a.out.js": 19230,
+ "a.out.js.gz": 8123,
"a.out.nodebug.wasm": 134729,
"a.out.nodebug.wasm.gz": 51522,
- "total": 153927,
- "total_gz": 59629,
+ "total": 153959,
+ "total_gz": 59645,
"sent": [
"__cxa_throw",
"_abort_js",
diff --git a/test/codesize/test_codesize_cxx_ctors2.json b/test/codesize/test_codesize_cxx_ctors2.json
index d1ae8cc748cf5..31b5282423488 100644
--- a/test/codesize/test_codesize_cxx_ctors2.json
+++ b/test/codesize/test_codesize_cxx_ctors2.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 19175,
- "a.out.js.gz": 8091,
+ "a.out.js": 19207,
+ "a.out.js.gz": 8106,
"a.out.nodebug.wasm": 134158,
"a.out.nodebug.wasm.gz": 51187,
- "total": 153333,
- "total_gz": 59278,
+ "total": 153365,
+ "total_gz": 59293,
"sent": [
"__cxa_throw",
"_abort_js",
diff --git a/test/codesize/test_codesize_cxx_except.json b/test/codesize/test_codesize_cxx_except.json
index b0f3ffae962aa..7bfc4912911c8 100644
--- a/test/codesize/test_codesize_cxx_except.json
+++ b/test/codesize/test_codesize_cxx_except.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 22904,
- "a.out.js.gz": 9078,
+ "a.out.js": 22936,
+ "a.out.js.gz": 9093,
"a.out.nodebug.wasm": 177195,
"a.out.nodebug.wasm.gz": 59099,
- "total": 200099,
- "total_gz": 68177,
+ "total": 200131,
+ "total_gz": 68192,
"sent": [
"__cxa_begin_catch",
"__cxa_end_catch",
diff --git a/test/codesize/test_codesize_cxx_except_wasm.json b/test/codesize/test_codesize_cxx_except_wasm.json
index 1c6b428368a23..17fb4be9dfd48 100644
--- a/test/codesize/test_codesize_cxx_except_wasm.json
+++ b/test/codesize/test_codesize_cxx_except_wasm.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 19007,
- "a.out.js.gz": 8036,
+ "a.out.js": 19039,
+ "a.out.js.gz": 8051,
"a.out.nodebug.wasm": 150458,
"a.out.nodebug.wasm.gz": 56588,
- "total": 169465,
- "total_gz": 64624,
+ "total": 169497,
+ "total_gz": 64639,
"sent": [
"_abort_js",
"_tzset_js",
diff --git a/test/codesize/test_codesize_cxx_except_wasm_legacy.json b/test/codesize/test_codesize_cxx_except_wasm_legacy.json
index f194eea78cdfc..a112c039e148e 100644
--- a/test/codesize/test_codesize_cxx_except_wasm_legacy.json
+++ b/test/codesize/test_codesize_cxx_except_wasm_legacy.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 19085,
- "a.out.js.gz": 8060,
+ "a.out.js": 19117,
+ "a.out.js.gz": 8076,
"a.out.nodebug.wasm": 148240,
"a.out.nodebug.wasm.gz": 56286,
- "total": 167325,
- "total_gz": 64346,
+ "total": 167357,
+ "total_gz": 64362,
"sent": [
"_abort_js",
"_tzset_js",
diff --git a/test/codesize/test_codesize_cxx_lto.json b/test/codesize/test_codesize_cxx_lto.json
index 0db28c3f8507f..52fde5b3263f3 100644
--- a/test/codesize/test_codesize_cxx_lto.json
+++ b/test/codesize/test_codesize_cxx_lto.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 18552,
- "a.out.js.gz": 7814,
+ "a.out.js": 18584,
+ "a.out.js.gz": 7830,
"a.out.nodebug.wasm": 100990,
"a.out.nodebug.wasm.gz": 38173,
- "total": 119542,
- "total_gz": 45987,
+ "total": 119574,
+ "total_gz": 46003,
"sent": [
"a (emscripten_resize_heap)",
"b (_setitimer_js)",
diff --git a/test/codesize/test_codesize_cxx_mangle.json b/test/codesize/test_codesize_cxx_mangle.json
index 7f2ce633c4573..8295c8e6b6bf8 100644
--- a/test/codesize/test_codesize_cxx_mangle.json
+++ b/test/codesize/test_codesize_cxx_mangle.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 22954,
- "a.out.js.gz": 9099,
+ "a.out.js": 22986,
+ "a.out.js.gz": 9113,
"a.out.nodebug.wasm": 243475,
"a.out.nodebug.wasm.gz": 81296,
- "total": 266429,
- "total_gz": 90395,
+ "total": 266461,
+ "total_gz": 90409,
"sent": [
"__cxa_begin_catch",
"__cxa_end_catch",
diff --git a/test/codesize/test_codesize_cxx_noexcept.json b/test/codesize/test_codesize_cxx_noexcept.json
index dc368be4bfb04..6544bb6fa3025 100644
--- a/test/codesize/test_codesize_cxx_noexcept.json
+++ b/test/codesize/test_codesize_cxx_noexcept.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 19198,
- "a.out.js.gz": 8107,
+ "a.out.js": 19230,
+ "a.out.js.gz": 8123,
"a.out.nodebug.wasm": 136639,
"a.out.nodebug.wasm.gz": 52140,
- "total": 155837,
- "total_gz": 60247,
+ "total": 155869,
+ "total_gz": 60263,
"sent": [
"__cxa_throw",
"_abort_js",
diff --git a/test/codesize/test_codesize_cxx_wasmfs.json b/test/codesize/test_codesize_cxx_wasmfs.json
index e8d25de16bbc4..813f67629d9ad 100644
--- a/test/codesize/test_codesize_cxx_wasmfs.json
+++ b/test/codesize/test_codesize_cxx_wasmfs.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 6594,
- "a.out.js.gz": 3145,
+ "a.out.js": 6602,
+ "a.out.js.gz": 3150,
"a.out.nodebug.wasm": 174361,
"a.out.nodebug.wasm.gz": 64898,
- "total": 180955,
- "total_gz": 68043,
+ "total": 180963,
+ "total_gz": 68048,
"sent": [
"__cxa_throw",
"_abort_js",
diff --git a/test/codesize/test_codesize_file_preload.expected.js b/test/codesize/test_codesize_file_preload.expected.js
index 024496f7d7701..7128ad9e6f808 100644
--- a/test/codesize/test_codesize_file_preload.expected.js
+++ b/test/codesize/test_codesize_file_preload.expected.js
@@ -187,7 +187,7 @@ if (ENVIRONMENT_IS_NODE) {
// These modules will usually be used on Node.js. Load them eagerly to avoid
// the complexity of lazy-loading.
var fs = require("node:fs");
- scriptDirectory = __dirname + "/";
+ scriptDirectory = `${__dirname}/`;
// include: node_shell_read.js
readBinary = filename => {
// We need to re-wrap `file://` strings to URLs.
@@ -260,7 +260,7 @@ if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {
if (response.ok) {
return response.arrayBuffer();
}
- throw new Error(response.status + " : " + response.url);
+ throw new Error(`${response.status} : ${response.url}`);
};
}
} else {}
@@ -571,7 +571,7 @@ var PATH = {
},
basename: path => path && path.match(/([^\/]+|\/)\/*$/)[1],
join: (...paths) => PATH.normalize(paths.join("/")),
- join2: (l, r) => PATH.normalize(l + "/" + r)
+ join2: (l, r) => PATH.normalize(`${l}/${r}`)
};
var initRandomFill = () => {
@@ -596,7 +596,7 @@ var PATH_FS = {
} else if (!path) {
return "";
}
- resolvedPath = path + "/" + resolvedPath;
+ resolvedPath = `${path}/${resolvedPath}`;
resolvedAbsolute = PATH.isAbs(path);
}
// At this point the path should be resolved to a full absolute path, but
@@ -1496,7 +1496,7 @@ var FS = {
}
opts.follow_mount ??= true;
if (!PATH.isAbs(path)) {
- path = FS.cwd() + "/" + path;
+ path = `${FS.cwd()}/${path}`;
}
// limit max consecutive symlinks to SYMLOOP_MAX.
linkloop: for (var nlinks = 0; nlinks < 40; nlinks++) {
@@ -1517,7 +1517,7 @@ var FS = {
if (parts[i] === "..") {
current_path = PATH.dirname(current_path);
if (FS.isRoot(current)) {
- path = current_path + "/" + parts.slice(i + 1).join("/");
+ path = `${current_path}/${parts.slice(i + 1).join("/")}`;
// We're making progress here, don't let many consecutive ..'s
// lead to ELOOP
nlinks--;
@@ -1553,9 +1553,9 @@ var FS = {
}
var link = current.node_ops.readlink(current);
if (!PATH.isAbs(link)) {
- link = PATH.dirname(current_path) + "/" + link;
+ link = `${PATH.dirname(current_path)}/${link}`;
}
- path = link + "/" + parts.slice(i + 1).join("/");
+ path = `${link}/${parts.slice(i + 1).join("/")}`;
continue linkloop;
}
}
@@ -3073,7 +3073,7 @@ var SYSCALLS = {
}
return dir;
}
- return dir + "/" + path;
+ return `${dir}/${path}`;
},
writeStat(buf, stat) {
HEAPU32[((buf) >> 2)] = stat.dev;
diff --git a/test/codesize/test_codesize_file_preload.json b/test/codesize/test_codesize_file_preload.json
index b953023499e05..52406b30721e8 100644
--- a/test/codesize/test_codesize_file_preload.json
+++ b/test/codesize/test_codesize_file_preload.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 22187,
- "a.out.js.gz": 9259,
+ "a.out.js": 22231,
+ "a.out.js.gz": 9271,
"a.out.nodebug.wasm": 1666,
"a.out.nodebug.wasm.gz": 945,
- "total": 23853,
- "total_gz": 10204,
+ "total": 23897,
+ "total_gz": 10216,
"sent": [
"a (fd_write)"
],
diff --git a/test/codesize/test_codesize_files_js_fs.json b/test/codesize/test_codesize_files_js_fs.json
index b60d8b6a54be8..d198a5ad8076e 100644
--- a/test/codesize/test_codesize_files_js_fs.json
+++ b/test/codesize/test_codesize_files_js_fs.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 17855,
- "a.out.js.gz": 7462,
+ "a.out.js": 17889,
+ "a.out.js.gz": 7482,
"a.out.nodebug.wasm": 381,
"a.out.nodebug.wasm.gz": 258,
- "total": 18236,
- "total_gz": 7720,
+ "total": 18270,
+ "total_gz": 7740,
"sent": [
"a (fd_write)",
"b (fd_read)",
diff --git a/test/codesize/test_codesize_files_wasmfs.json b/test/codesize/test_codesize_files_wasmfs.json
index de684ed10d467..1ef4c3af4c131 100644
--- a/test/codesize/test_codesize_files_wasmfs.json
+++ b/test/codesize/test_codesize_files_wasmfs.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 4979,
- "a.out.js.gz": 2409,
+ "a.out.js": 4985,
+ "a.out.js.gz": 2413,
"a.out.nodebug.wasm": 58253,
"a.out.nodebug.wasm.gz": 18290,
- "total": 63232,
- "total_gz": 20699,
+ "total": 63238,
+ "total_gz": 20703,
"sent": [
"a (emscripten_date_now)",
"b (emscripten_err)",
diff --git a/test/codesize/test_codesize_hello_O0.json b/test/codesize/test_codesize_hello_O0.json
index 84b78a36b3cac..d2a3b71ddcf7a 100644
--- a/test/codesize/test_codesize_hello_O0.json
+++ b/test/codesize/test_codesize_hello_O0.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 23494,
- "a.out.js.gz": 8565,
+ "a.out.js": 23492,
+ "a.out.js.gz": 8570,
"a.out.nodebug.wasm": 15115,
"a.out.nodebug.wasm.gz": 7464,
- "total": 38609,
- "total_gz": 16029,
+ "total": 38607,
+ "total_gz": 16034,
"sent": [
"fd_write"
],
diff --git a/test/codesize/test_codesize_hello_O1.json b/test/codesize/test_codesize_hello_O1.json
index b6cbfdd357df5..a8e567a2e918b 100644
--- a/test/codesize/test_codesize_hello_O1.json
+++ b/test/codesize/test_codesize_hello_O1.json
@@ -1,10 +1,10 @@
{
"a.out.js": 5516,
- "a.out.js.gz": 2242,
+ "a.out.js.gz": 2240,
"a.out.nodebug.wasm": 2544,
"a.out.nodebug.wasm.gz": 1436,
"total": 8060,
- "total_gz": 3678,
+ "total_gz": 3676,
"sent": [
"fd_write"
],
diff --git a/test/codesize/test_codesize_hello_O2.json b/test/codesize/test_codesize_hello_O2.json
index ffa925f61aa27..37c0594a09db4 100644
--- a/test/codesize/test_codesize_hello_O2.json
+++ b/test/codesize/test_codesize_hello_O2.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 3855,
- "a.out.js.gz": 1966,
+ "a.out.js": 3861,
+ "a.out.js.gz": 1969,
"a.out.nodebug.wasm": 1912,
"a.out.nodebug.wasm.gz": 1129,
- "total": 5767,
- "total_gz": 3095,
+ "total": 5773,
+ "total_gz": 3098,
"sent": [
"fd_write"
],
diff --git a/test/codesize/test_codesize_hello_O3.json b/test/codesize/test_codesize_hello_O3.json
index e5e1dd06d3f4a..6c37b70dd4aad 100644
--- a/test/codesize/test_codesize_hello_O3.json
+++ b/test/codesize/test_codesize_hello_O3.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 3797,
- "a.out.js.gz": 1925,
+ "a.out.js": 3803,
+ "a.out.js.gz": 1928,
"a.out.nodebug.wasm": 1666,
"a.out.nodebug.wasm.gz": 945,
- "total": 5463,
- "total_gz": 2870,
+ "total": 5469,
+ "total_gz": 2873,
"sent": [
"a (fd_write)"
],
diff --git a/test/codesize/test_codesize_hello_Os.json b/test/codesize/test_codesize_hello_Os.json
index 989b872d675a7..24faf2583f434 100644
--- a/test/codesize/test_codesize_hello_Os.json
+++ b/test/codesize/test_codesize_hello_Os.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 3797,
- "a.out.js.gz": 1925,
+ "a.out.js": 3803,
+ "a.out.js.gz": 1928,
"a.out.nodebug.wasm": 1654,
"a.out.nodebug.wasm.gz": 953,
- "total": 5451,
- "total_gz": 2878,
+ "total": 5457,
+ "total_gz": 2881,
"sent": [
"a (fd_write)"
],
diff --git a/test/codesize/test_codesize_hello_Oz.json b/test/codesize/test_codesize_hello_Oz.json
index 96405ea5ca1ba..54a0ee342caf8 100644
--- a/test/codesize/test_codesize_hello_Oz.json
+++ b/test/codesize/test_codesize_hello_Oz.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 3434,
- "a.out.js.gz": 1729,
+ "a.out.js": 3440,
+ "a.out.js.gz": 1732,
"a.out.nodebug.wasm": 1188,
"a.out.nodebug.wasm.gz": 731,
- "total": 4622,
- "total_gz": 2460,
+ "total": 4628,
+ "total_gz": 2463,
"sent": [
"a (fd_write)"
],
diff --git a/test/codesize/test_codesize_hello_dylink.json b/test/codesize/test_codesize_hello_dylink.json
index c5938c612445e..3c92574e1e041 100644
--- a/test/codesize/test_codesize_hello_dylink.json
+++ b/test/codesize/test_codesize_hello_dylink.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 26242,
- "a.out.js.gz": 11203,
+ "a.out.js": 26274,
+ "a.out.js.gz": 11220,
"a.out.nodebug.wasm": 17863,
"a.out.nodebug.wasm.gz": 9016,
- "total": 44105,
- "total_gz": 20219,
+ "total": 44137,
+ "total_gz": 20236,
"sent": [
"__syscall_stat64",
"emscripten_resize_heap",
diff --git a/test/codesize/test_codesize_hello_dylink_all.json b/test/codesize/test_codesize_hello_dylink_all.json
index a8cc65ed1b26f..3e879849b2552 100644
--- a/test/codesize/test_codesize_hello_dylink_all.json
+++ b/test/codesize/test_codesize_hello_dylink_all.json
@@ -1,7 +1,7 @@
{
- "a.out.js": 267896,
+ "a.out.js": 268003,
"a.out.nodebug.wasm": 588311,
- "total": 856207,
+ "total": 856314,
"sent": [
"IMG_Init",
"IMG_Load",
diff --git a/test/codesize/test_codesize_hello_esm_integration.json b/test/codesize/test_codesize_hello_esm_integration.json
index 49aa34bab2902..1f33b773618c9 100644
--- a/test/codesize/test_codesize_hello_esm_integration.json
+++ b/test/codesize/test_codesize_hello_esm_integration.json
@@ -1,12 +1,12 @@
{
"a.out.mjs": 671,
"a.out.mjs.gz": 401,
- "a.out.support.mjs": 6089,
- "a.out.support.mjs.gz": 2388,
+ "a.out.support.mjs": 6093,
+ "a.out.support.mjs.gz": 2392,
"a.out.nodebug.wasm": 1688,
"a.out.nodebug.wasm.gz": 973,
- "total": 8448,
- "total_gz": 3762,
+ "total": 8452,
+ "total_gz": 3766,
"sent": [
"a (fd_write)"
],
diff --git a/test/codesize/test_codesize_hello_export_nothing.json b/test/codesize/test_codesize_hello_export_nothing.json
index c4012b3373c4f..138a7281b0bca 100644
--- a/test/codesize/test_codesize_hello_export_nothing.json
+++ b/test/codesize/test_codesize_hello_export_nothing.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 2642,
- "a.out.js.gz": 1290,
+ "a.out.js": 2648,
+ "a.out.js.gz": 1292,
"a.out.nodebug.wasm": 43,
"a.out.nodebug.wasm.gz": 59,
- "total": 2685,
- "total_gz": 1349,
+ "total": 2691,
+ "total_gz": 1351,
"sent": [],
"imports": [],
"exports": [
diff --git a/test/codesize/test_codesize_hello_wasmfs.json b/test/codesize/test_codesize_hello_wasmfs.json
index e5e1dd06d3f4a..6c37b70dd4aad 100644
--- a/test/codesize/test_codesize_hello_wasmfs.json
+++ b/test/codesize/test_codesize_hello_wasmfs.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 3797,
- "a.out.js.gz": 1925,
+ "a.out.js": 3803,
+ "a.out.js.gz": 1928,
"a.out.nodebug.wasm": 1666,
"a.out.nodebug.wasm.gz": 945,
- "total": 5463,
- "total_gz": 2870,
+ "total": 5469,
+ "total_gz": 2873,
"sent": [
"a (fd_write)"
],
diff --git a/test/codesize/test_codesize_libcxxabi_message_O3.json b/test/codesize/test_codesize_libcxxabi_message_O3.json
index a3d564f5f2563..6204a0e517441 100644
--- a/test/codesize/test_codesize_libcxxabi_message_O3.json
+++ b/test/codesize/test_codesize_libcxxabi_message_O3.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 3010,
- "a.out.js.gz": 1480,
+ "a.out.js": 3016,
+ "a.out.js.gz": 1482,
"a.out.nodebug.wasm": 89,
"a.out.nodebug.wasm.gz": 98,
- "total": 3099,
- "total_gz": 1578,
+ "total": 3105,
+ "total_gz": 1580,
"sent": [],
"imports": [],
"exports": [
diff --git a/test/codesize/test_codesize_libcxxabi_message_O3_standalone.json b/test/codesize/test_codesize_libcxxabi_message_O3_standalone.json
index 2cc7597db55ab..5f7a6e54586d5 100644
--- a/test/codesize/test_codesize_libcxxabi_message_O3_standalone.json
+++ b/test/codesize/test_codesize_libcxxabi_message_O3_standalone.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 3093,
- "a.out.js.gz": 1530,
+ "a.out.js": 3099,
+ "a.out.js.gz": 1532,
"a.out.nodebug.wasm": 222,
"a.out.nodebug.wasm.gz": 206,
- "total": 3315,
- "total_gz": 1736,
+ "total": 3321,
+ "total_gz": 1738,
"sent": [
"proc_exit"
],
diff --git a/test/codesize/test_codesize_mem_O3.json b/test/codesize/test_codesize_mem_O3.json
index edf3e5187bb33..5ae8ccfcf5af4 100644
--- a/test/codesize/test_codesize_mem_O3.json
+++ b/test/codesize/test_codesize_mem_O3.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 3875,
- "a.out.js.gz": 1925,
+ "a.out.js": 3881,
+ "a.out.js.gz": 1928,
"a.out.nodebug.wasm": 5260,
"a.out.nodebug.wasm.gz": 2419,
- "total": 9135,
- "total_gz": 4344,
+ "total": 9141,
+ "total_gz": 4347,
"sent": [
"a (emscripten_resize_heap)"
],
diff --git a/test/codesize/test_codesize_mem_O3_grow.json b/test/codesize/test_codesize_mem_O3_grow.json
index 73335d508a3b3..0f41d6abd2d6d 100644
--- a/test/codesize/test_codesize_mem_O3_grow.json
+++ b/test/codesize/test_codesize_mem_O3_grow.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 4209,
- "a.out.js.gz": 2101,
+ "a.out.js": 4215,
+ "a.out.js.gz": 2105,
"a.out.nodebug.wasm": 5261,
"a.out.nodebug.wasm.gz": 2419,
- "total": 9470,
- "total_gz": 4520,
+ "total": 9476,
+ "total_gz": 4524,
"sent": [
"a (emscripten_resize_heap)"
],
diff --git a/test/codesize/test_codesize_mem_O3_grow_standalone.json b/test/codesize/test_codesize_mem_O3_grow_standalone.json
index af93a44fbfbbd..95fb04c598840 100644
--- a/test/codesize/test_codesize_mem_O3_grow_standalone.json
+++ b/test/codesize/test_codesize_mem_O3_grow_standalone.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 3657,
- "a.out.js.gz": 1834,
+ "a.out.js": 3663,
+ "a.out.js.gz": 1836,
"a.out.nodebug.wasm": 5641,
"a.out.nodebug.wasm.gz": 2659,
- "total": 9298,
- "total_gz": 4493,
+ "total": 9304,
+ "total_gz": 4495,
"sent": [
"args_get",
"args_sizes_get",
diff --git a/test/codesize/test_codesize_mem_O3_standalone.json b/test/codesize/test_codesize_mem_O3_standalone.json
index f59a6faade92b..10ea32fac5180 100644
--- a/test/codesize/test_codesize_mem_O3_standalone.json
+++ b/test/codesize/test_codesize_mem_O3_standalone.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 3567,
- "a.out.js.gz": 1784,
+ "a.out.js": 3573,
+ "a.out.js.gz": 1785,
"a.out.nodebug.wasm": 5565,
"a.out.nodebug.wasm.gz": 2598,
- "total": 9132,
- "total_gz": 4382,
+ "total": 9138,
+ "total_gz": 4383,
"sent": [
"args_get",
"args_sizes_get",
diff --git a/test/codesize/test_codesize_mem_O3_standalone_lib.json b/test/codesize/test_codesize_mem_O3_standalone_lib.json
index 0a84f5aac944c..e03c4513a7601 100644
--- a/test/codesize/test_codesize_mem_O3_standalone_lib.json
+++ b/test/codesize/test_codesize_mem_O3_standalone_lib.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 3086,
- "a.out.js.gz": 1523,
+ "a.out.js": 3092,
+ "a.out.js.gz": 1525,
"a.out.nodebug.wasm": 5239,
"a.out.nodebug.wasm.gz": 2359,
- "total": 8325,
- "total_gz": 3882,
+ "total": 8331,
+ "total_gz": 3884,
"sent": [],
"imports": [],
"exports": [
diff --git a/test/codesize/test_codesize_mem_O3_standalone_narg.json b/test/codesize/test_codesize_mem_O3_standalone_narg.json
index ab2c10ce526cb..5b69e94ed1c41 100644
--- a/test/codesize/test_codesize_mem_O3_standalone_narg.json
+++ b/test/codesize/test_codesize_mem_O3_standalone_narg.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 3093,
- "a.out.js.gz": 1530,
+ "a.out.js": 3099,
+ "a.out.js.gz": 1532,
"a.out.nodebug.wasm": 5354,
"a.out.nodebug.wasm.gz": 2442,
- "total": 8447,
- "total_gz": 3972,
+ "total": 8453,
+ "total_gz": 3974,
"sent": [
"proc_exit"
],
diff --git a/test/codesize/test_codesize_mem_O3_standalone_narg_flto.json b/test/codesize/test_codesize_mem_O3_standalone_narg_flto.json
index 6c4c65673d848..c7ddf05d18717 100644
--- a/test/codesize/test_codesize_mem_O3_standalone_narg_flto.json
+++ b/test/codesize/test_codesize_mem_O3_standalone_narg_flto.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 3093,
- "a.out.js.gz": 1530,
+ "a.out.js": 3099,
+ "a.out.js.gz": 1532,
"a.out.nodebug.wasm": 4285,
"a.out.nodebug.wasm.gz": 2142,
- "total": 7378,
- "total_gz": 3672,
+ "total": 7384,
+ "total_gz": 3674,
"sent": [
"proc_exit"
],
diff --git a/test/codesize/test_codesize_minimal_64.json b/test/codesize/test_codesize_minimal_64.json
index 337855a8c4b26..23cd8231f7367 100644
--- a/test/codesize/test_codesize_minimal_64.json
+++ b/test/codesize/test_codesize_minimal_64.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 2313,
- "a.out.js.gz": 1138,
+ "a.out.js": 2319,
+ "a.out.js.gz": 1140,
"a.out.nodebug.wasm": 75,
"a.out.nodebug.wasm.gz": 88,
- "total": 2388,
- "total_gz": 1226,
+ "total": 2394,
+ "total_gz": 1228,
"sent": [],
"imports": [],
"exports": [
diff --git a/test/codesize/test_codesize_minimal_O0.expected.js b/test/codesize/test_codesize_minimal_O0.expected.js
index 3c2b4c0164320..0c062a95976fd 100644
--- a/test/codesize/test_codesize_minimal_O0.expected.js
+++ b/test/codesize/test_codesize_minimal_O0.expected.js
@@ -114,7 +114,7 @@ if (ENVIRONMENT_IS_NODE) {
// the complexity of lazy-loading.
var fs = require('node:fs');
- scriptDirectory = __dirname + '/';
+ scriptDirectory = `${__dirname}/`;
// include: node_shell_read.js
readBinary = (filename) => {
@@ -204,7 +204,7 @@ if (ENVIRONMENT_IS_WORKER) {
if (response.ok) {
return response.arrayBuffer();
}
- throw new Error(response.status + ' : ' + response.url);
+ throw new Error(`${response.status} : ${response.url}`);
};
// end include: web_or_worker_shell_read.js
}
@@ -272,7 +272,7 @@ var EXITSTATUS;
/** @type {function(*, string=)} */
function assert(condition, text) {
if (!condition) {
- abort('Assertion failed' + (text ? ': ' + text : ''));
+ abort(`Assertion failed${text ? `: ${text}` : ''}`);
}
}
@@ -411,7 +411,7 @@ function missingLibrarySymbol(sym) {
// for a JS name like _name.
var librarySymbol = sym;
if (!librarySymbol.startsWith('_')) {
- librarySymbol = '$' + sym;
+ librarySymbol = `$${sym}`;
}
msg += ` (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='${librarySymbol}')`;
if (isExportedByForceFilesystem(sym)) {
@@ -465,7 +465,7 @@ function writeStackCookie() {
}
function u32ToHexString(num) {
- return '0x' + (num >>> 0).toString(16).padStart(8, '0');
+ return `0x${(num >>> 0).toString(16).padStart(8, '0')}`;
}
function checkStackCookie() {
@@ -755,7 +755,7 @@ async function createWasm() {
assert(typeof ptr === 'number', `ptrToString expects a number, got ${typeof ptr}`);
// Convert to 32-bit unsigned value
ptr >>>= 0;
- return '0x' + ptr.toString(16).padStart(8, '0');
+ return `0x${ptr.toString(16).padStart(8, '0')}`;
}
var stackRestore = (val) => __emscripten_stack_restore(val);
@@ -766,7 +766,7 @@ async function createWasm() {
warnOnce.shown ||= {};
if (!warnOnce.shown[text]) {
warnOnce.shown[text] = 1;
- if (ENVIRONMENT_IS_NODE) text = 'warning: ' + text;
+ if (ENVIRONMENT_IS_NODE) text = `warning: ${text}`;
err(text);
}
};
diff --git a/test/codesize/test_codesize_minimal_O0.json b/test/codesize/test_codesize_minimal_O0.json
index 80fb306ad0307..335f7e391ed49 100644
--- a/test/codesize/test_codesize_minimal_O0.json
+++ b/test/codesize/test_codesize_minimal_O0.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 18703,
- "a.out.js.gz": 6742,
+ "a.out.js": 18701,
+ "a.out.js.gz": 6748,
"a.out.nodebug.wasm": 1015,
"a.out.nodebug.wasm.gz": 602,
- "total": 19718,
- "total_gz": 7344,
+ "total": 19716,
+ "total_gz": 7350,
"sent": [],
"imports": [],
"exports": [
diff --git a/test/codesize/test_codesize_minimal_O2.json b/test/codesize/test_codesize_minimal_O2.json
index 3436eb3b2d8eb..36032945dd633 100644
--- a/test/codesize/test_codesize_minimal_O2.json
+++ b/test/codesize/test_codesize_minimal_O2.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 2052,
- "a.out.js.gz": 1058,
+ "a.out.js": 2058,
+ "a.out.js.gz": 1060,
"a.out.nodebug.wasm": 280,
"a.out.nodebug.wasm.gz": 226,
- "total": 2332,
- "total_gz": 1284,
+ "total": 2338,
+ "total_gz": 1286,
"sent": [],
"imports": [],
"exports": [
diff --git a/test/codesize/test_codesize_minimal_O3.json b/test/codesize/test_codesize_minimal_O3.json
index 5fe4c0860fef6..8d82187f2a5f3 100644
--- a/test/codesize/test_codesize_minimal_O3.json
+++ b/test/codesize/test_codesize_minimal_O3.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 1998,
- "a.out.js.gz": 1027,
+ "a.out.js": 2004,
+ "a.out.js.gz": 1029,
"a.out.nodebug.wasm": 75,
"a.out.nodebug.wasm.gz": 87,
- "total": 2073,
- "total_gz": 1114,
+ "total": 2079,
+ "total_gz": 1116,
"sent": [],
"imports": [],
"exports": [
diff --git a/test/codesize/test_codesize_minimal_Os.json b/test/codesize/test_codesize_minimal_Os.json
index 5fe4c0860fef6..8d82187f2a5f3 100644
--- a/test/codesize/test_codesize_minimal_Os.json
+++ b/test/codesize/test_codesize_minimal_Os.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 1998,
- "a.out.js.gz": 1027,
+ "a.out.js": 2004,
+ "a.out.js.gz": 1029,
"a.out.nodebug.wasm": 75,
"a.out.nodebug.wasm.gz": 87,
- "total": 2073,
- "total_gz": 1114,
+ "total": 2079,
+ "total_gz": 1116,
"sent": [],
"imports": [],
"exports": [
diff --git a/test/codesize/test_codesize_minimal_Oz-ctors.json b/test/codesize/test_codesize_minimal_Oz-ctors.json
index 01649ef200d36..2cd6865c3e459 100644
--- a/test/codesize/test_codesize_minimal_Oz-ctors.json
+++ b/test/codesize/test_codesize_minimal_Oz-ctors.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 1980,
- "a.out.js.gz": 1012,
+ "a.out.js": 1986,
+ "a.out.js.gz": 1015,
"a.out.nodebug.wasm": 64,
"a.out.nodebug.wasm.gz": 80,
- "total": 2044,
- "total_gz": 1092,
+ "total": 2050,
+ "total_gz": 1095,
"sent": [],
"imports": [],
"exports": [
diff --git a/test/codesize/test_codesize_minimal_Oz.json b/test/codesize/test_codesize_minimal_Oz.json
index 5fe4c0860fef6..8d82187f2a5f3 100644
--- a/test/codesize/test_codesize_minimal_Oz.json
+++ b/test/codesize/test_codesize_minimal_Oz.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 1998,
- "a.out.js.gz": 1027,
+ "a.out.js": 2004,
+ "a.out.js.gz": 1029,
"a.out.nodebug.wasm": 75,
"a.out.nodebug.wasm.gz": 87,
- "total": 2073,
- "total_gz": 1114,
+ "total": 2079,
+ "total_gz": 1116,
"sent": [],
"imports": [],
"exports": [
diff --git a/test/codesize/test_codesize_minimal_esm.json b/test/codesize/test_codesize_minimal_esm.json
index fe01e4510c897..5c90ea2cf02c6 100644
--- a/test/codesize/test_codesize_minimal_esm.json
+++ b/test/codesize/test_codesize_minimal_esm.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 2137,
- "a.out.js.gz": 1050,
+ "a.out.js": 2141,
+ "a.out.js.gz": 1049,
"a.out.nodebug.wasm": 75,
"a.out.nodebug.wasm.gz": 87,
- "total": 2212,
- "total_gz": 1137,
+ "total": 2216,
+ "total_gz": 1136,
"sent": [],
"imports": [],
"exports": [
diff --git a/test/codesize/test_codesize_minimal_esm_integration.json b/test/codesize/test_codesize_minimal_esm_integration.json
index fe1f704a08903..32a842b2aeb10 100644
--- a/test/codesize/test_codesize_minimal_esm_integration.json
+++ b/test/codesize/test_codesize_minimal_esm_integration.json
@@ -1,12 +1,12 @@
{
"a.out.mjs": 683,
"a.out.mjs.gz": 410,
- "a.out.support.mjs": 2963,
- "a.out.support.mjs.gz": 1233,
+ "a.out.support.mjs": 2967,
+ "a.out.support.mjs.gz": 1235,
"a.out.nodebug.wasm": 75,
"a.out.nodebug.wasm.gz": 87,
- "total": 3721,
- "total_gz": 1730,
+ "total": 3725,
+ "total_gz": 1732,
"sent": [],
"imports": [],
"exports": [
diff --git a/test/codesize/test_codesize_minimal_pthreads.json b/test/codesize/test_codesize_minimal_pthreads.json
index 43f744cf97b4f..006242ab7918f 100644
--- a/test/codesize/test_codesize_minimal_pthreads.json
+++ b/test/codesize/test_codesize_minimal_pthreads.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 6856,
- "a.out.js.gz": 3406,
+ "a.out.js": 6862,
+ "a.out.js.gz": 3411,
"a.out.nodebug.wasm": 19108,
"a.out.nodebug.wasm.gz": 8823,
- "total": 25964,
- "total_gz": 12229,
+ "total": 25970,
+ "total_gz": 12234,
"sent": [
"a (memory)",
"b (exit)",
diff --git a/test/codesize/test_codesize_minimal_pthreads_memgrowth.json b/test/codesize/test_codesize_minimal_pthreads_memgrowth.json
index c7d20dad4ac1b..a41895e68dbdc 100644
--- a/test/codesize/test_codesize_minimal_pthreads_memgrowth.json
+++ b/test/codesize/test_codesize_minimal_pthreads_memgrowth.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 7307,
- "a.out.js.gz": 3624,
+ "a.out.js": 7313,
+ "a.out.js.gz": 3627,
"a.out.nodebug.wasm": 19109,
"a.out.nodebug.wasm.gz": 8826,
- "total": 26416,
- "total_gz": 12450,
+ "total": 26422,
+ "total_gz": 12453,
"sent": [
"a (memory)",
"b (exit)",
diff --git a/test/codesize/test_codesize_minimal_wasmfs.json b/test/codesize/test_codesize_minimal_wasmfs.json
index 5fe4c0860fef6..8d82187f2a5f3 100644
--- a/test/codesize/test_codesize_minimal_wasmfs.json
+++ b/test/codesize/test_codesize_minimal_wasmfs.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 1998,
- "a.out.js.gz": 1027,
+ "a.out.js": 2004,
+ "a.out.js.gz": 1029,
"a.out.nodebug.wasm": 75,
"a.out.nodebug.wasm.gz": 87,
- "total": 2073,
- "total_gz": 1114,
+ "total": 2079,
+ "total_gz": 1116,
"sent": [],
"imports": [],
"exports": [
diff --git a/test/codesize/test_minimal_runtime_code_size_hello_webgl2_wasm.json b/test/codesize/test_minimal_runtime_code_size_hello_webgl2_wasm.json
index 227653dcc03e8..835155234187b 100644
--- a/test/codesize/test_minimal_runtime_code_size_hello_webgl2_wasm.json
+++ b/test/codesize/test_minimal_runtime_code_size_hello_webgl2_wasm.json
@@ -1,10 +1,10 @@
{
"a.html": 450,
"a.html.gz": 318,
- "a.js": 4423,
- "a.js.gz": 2270,
+ "a.js": 4427,
+ "a.js.gz": 2279,
"a.wasm": 8313,
"a.wasm.gz": 5646,
- "total": 13186,
- "total_gz": 8234
+ "total": 13190,
+ "total_gz": 8243
}
diff --git a/test/codesize/test_minimal_runtime_code_size_hello_webgl2_wasm2js.json b/test/codesize/test_minimal_runtime_code_size_hello_webgl2_wasm2js.json
index 9e0775c7bbb04..25fba8c048044 100644
--- a/test/codesize/test_minimal_runtime_code_size_hello_webgl2_wasm2js.json
+++ b/test/codesize/test_minimal_runtime_code_size_hello_webgl2_wasm2js.json
@@ -1,8 +1,8 @@
{
"a.html": 342,
"a.html.gz": 252,
- "a.js": 18217,
- "a.js.gz": 9827,
- "total": 18559,
- "total_gz": 10079
+ "a.js": 18221,
+ "a.js.gz": 9837,
+ "total": 18563,
+ "total_gz": 10089
}
diff --git a/test/codesize/test_minimal_runtime_code_size_hello_webgl2_wasm_singlefile.json b/test/codesize/test_minimal_runtime_code_size_hello_webgl2_wasm_singlefile.json
index 1a8c46bd18e82..553d93f19c2ca 100644
--- a/test/codesize/test_minimal_runtime_code_size_hello_webgl2_wasm_singlefile.json
+++ b/test/codesize/test_minimal_runtime_code_size_hello_webgl2_wasm_singlefile.json
@@ -1,4 +1,4 @@
{
- "a.html": 15040,
- "a.html.gz": 9027
+ "a.html": 15044,
+ "a.html.gz": 9035
}
diff --git a/test/codesize/test_minimal_runtime_code_size_hello_webgl_wasm.json b/test/codesize/test_minimal_runtime_code_size_hello_webgl_wasm.json
index 318bc1fae19d2..db180e44de956 100644
--- a/test/codesize/test_minimal_runtime_code_size_hello_webgl_wasm.json
+++ b/test/codesize/test_minimal_runtime_code_size_hello_webgl_wasm.json
@@ -1,10 +1,10 @@
{
"a.html": 450,
"a.html.gz": 318,
- "a.js": 3961,
- "a.js.gz": 2108,
+ "a.js": 3965,
+ "a.js.gz": 2117,
"a.wasm": 8313,
"a.wasm.gz": 5646,
- "total": 12724,
- "total_gz": 8072
+ "total": 12728,
+ "total_gz": 8081
}
diff --git a/test/codesize/test_minimal_runtime_code_size_hello_webgl_wasm2js.json b/test/codesize/test_minimal_runtime_code_size_hello_webgl_wasm2js.json
index 1913104dfaf56..69de0eae3bf79 100644
--- a/test/codesize/test_minimal_runtime_code_size_hello_webgl_wasm2js.json
+++ b/test/codesize/test_minimal_runtime_code_size_hello_webgl_wasm2js.json
@@ -1,8 +1,8 @@
{
"a.html": 342,
"a.html.gz": 252,
- "a.js": 17743,
- "a.js.gz": 9663,
- "total": 18085,
- "total_gz": 9915
+ "a.js": 17747,
+ "a.js.gz": 9674,
+ "total": 18089,
+ "total_gz": 9926
}
diff --git a/test/codesize/test_small_js_flags.expected.js b/test/codesize/test_small_js_flags.expected.js
index 1b5aa349a4476..1bfe52dc0f8d0 100644
--- a/test/codesize/test_small_js_flags.expected.js
+++ b/test/codesize/test_small_js_flags.expected.js
@@ -56,7 +56,7 @@ if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {
if (response.ok) {
return response.arrayBuffer();
}
- throw new Error(response.status + " : " + response.url);
+ throw new Error(`${response.status} : ${response.url}`);
};
}
} else {}
diff --git a/test/codesize/test_small_js_flags.json b/test/codesize/test_small_js_flags.json
index bdf5486448901..0b097ffe67917 100644
--- a/test/codesize/test_small_js_flags.json
+++ b/test/codesize/test_small_js_flags.json
@@ -1,10 +1,10 @@
{
- "a.out.js": 2062,
- "a.out.js.gz": 1182,
+ "a.out.js": 2066,
+ "a.out.js.gz": 1183,
"a.out.nodebug.wasm": 1666,
"a.out.nodebug.wasm.gz": 945,
- "total": 3728,
- "total_gz": 2127,
+ "total": 3732,
+ "total_gz": 2128,
"sent": [
"a (fd_write)"
],
diff --git a/test/codesize/test_unoptimized_code_size.json b/test/codesize/test_unoptimized_code_size.json
index 9e4745e439d93..c69978c1235da 100644
--- a/test/codesize/test_unoptimized_code_size.json
+++ b/test/codesize/test_unoptimized_code_size.json
@@ -1,16 +1,16 @@
{
- "hello_world.js": 54578,
- "hello_world.js.gz": 17345,
+ "hello_world.js": 54576,
+ "hello_world.js.gz": 17348,
"hello_world.wasm": 15115,
"hello_world.wasm.gz": 7464,
"no_asserts.js": 23629,
- "no_asserts.js.gz": 8288,
+ "no_asserts.js.gz": 8291,
"no_asserts.wasm": 12229,
"no_asserts.wasm.gz": 6004,
- "strict.js": 51729,
- "strict.js.gz": 16348,
+ "strict.js": 51727,
+ "strict.js.gz": 16350,
"strict.wasm": 15115,
"strict.wasm.gz": 7461,
- "total": 172395,
- "total_gz": 62910
+ "total": 172391,
+ "total_gz": 62918
}