Skip to content

Commit c79b0b1

Browse files
authored
More usage of JS string template literals. NFC (emscripten-core#19449)
1 parent 38e4b1f commit c79b0b1

37 files changed

Lines changed: 123 additions & 124 deletions

src/library.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3818,14 +3818,14 @@ function wrapSyscallFunction(x, library, isWasi) {
38183818
post += 'SYSCALLS.varargs = undefined;\n';
38193819
}
38203820
}
3821-
pre += "dbg('syscall! " + x + ": [' + Array.prototype.slice.call(arguments) + ']');\n";
3821+
pre += `dbg('syscall! ${x}: [' + Array.prototype.slice.call(arguments) + ']');\n`;
38223822
pre += "var canWarn = true;\n";
38233823
pre += "var ret = (function() {\n";
38243824
post += "})();\n";
38253825
post += "if (ret && ret < 0 && canWarn) {\n";
3826-
post += " dbg('error: syscall may have failed with ' + (-ret) + ' (' + ERRNO_MESSAGES[-ret] + ')');\n";
3826+
post += " dbg(`error: syscall may have failed with ${-ret} (${ERRNO_MESSAGES[-ret]})`);\n";
38273827
post += "}\n";
3828-
post += "dbg('syscall return: ' + ret);\n";
3828+
post += "dbg(`syscall return: ${ret}`);\n";
38293829
post += "return ret;\n";
38303830
#endif
38313831
delete library[x + '__nothrow'];
@@ -3837,7 +3837,7 @@ function wrapSyscallFunction(x, library, isWasi) {
38373837
" if (typeof FS == 'undefined' || !(e.name === 'ErrnoError')) throw e;\n";
38383838
#if SYSCALL_DEBUG
38393839
handler +=
3840-
" dbg('error: syscall failed with ' + e.errno + ' (' + ERRNO_MESSAGES[e.errno] + ')');\n" +
3840+
" dbg(`error: syscall failed with ${e.errno} (${ERRNO_MESSAGES[e.errno]})`);\n" +
38413841
" canWarn = false;\n";
38423842
#endif
38433843
// Musl syscalls are negated.

src/library_fs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,7 @@ FS.staticInit();` +
10791079
if (!(path in FS.readFiles)) {
10801080
FS.readFiles[path] = 1;
10811081
#if FS_DEBUG
1082-
dbg("FS.trackingDelegate error on read file: " + path);
1082+
dbg(`FS.trackingDelegate error on read file: ${path}`);
10831083
#endif
10841084
}
10851085
}

src/library_html5.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2335,15 +2335,14 @@ var LibraryHTML5 = {
23352335
// TODO: Perhaps autoResizeViewport should only be true if FBO 0 is currently active?
23362336
autoResizeViewport = (prevViewport[0] === 0 && prevViewport[1] === 0 && prevViewport[2] === canvas.width && prevViewport[3] === canvas.height);
23372337
#if GL_DEBUG
2338-
dbg('Resizing canvas from ' + canvas.width + 'x' + canvas.height + ' to ' + width + 'x' + height + '. Previous GL viewport size was '
2339-
+ prevViewport + ', so autoResizeViewport=' + autoResizeViewport);
2338+
dbg(`Resizing canvas from ${canvas.width}x${canvas.height} to ${width}x${height}. Previous GL viewport size was ${prevViewport}, so autoResizeViewport=${autoResizeViewport}`);
23402339
#endif
23412340
}
23422341
canvas.width = width;
23432342
canvas.height = height;
23442343
if (autoResizeViewport) {
23452344
#if GL_DEBUG
2346-
dbg('Automatically resizing GL viewport to cover whole render target ' + width + 'x' + height);
2345+
dbg(`Automatically resizing GL viewport to cover whole render target ${width}x${height}`);
23472346
#endif
23482347
// TODO: Add -sCANVAS_RESIZE_SETS_GL_VIEWPORT=0/1 option (default=1). This is commonly done and several graphics engines depend on this,
23492348
// but this can be quite disruptive.
@@ -2408,7 +2407,7 @@ var LibraryHTML5 = {
24082407
emscripten_set_canvas_element_size__deps: ['$JSEvents', '$setCanvasElementSizeCallingThread', '$setCanvasElementSizeMainThread', '$findCanvasEventTarget'],
24092408
emscripten_set_canvas_element_size: function(target, width, height) {
24102409
#if GL_DEBUG
2411-
dbg('emscripten_set_canvas_element_size(target='+target+',width='+width+',height='+height);
2410+
dbg(`emscripten_set_canvas_element_size(target=${target},width=${width},height=${height}`);
24122411
#endif
24132412
var canvas = findCanvasEventTarget(target);
24142413
if (canvas) {
@@ -2420,7 +2419,7 @@ var LibraryHTML5 = {
24202419
emscripten_set_canvas_element_size__deps: ['$JSEvents', '$findCanvasEventTarget'],
24212420
emscripten_set_canvas_element_size: function(target, width, height) {
24222421
#if GL_DEBUG
2423-
dbg('emscripten_set_canvas_element_size(target='+target+',width='+width+',height='+height);
2422+
dbg(`emscripten_set_canvas_element_size(target=${target},width=${width},height=${height}`);
24242423
#endif
24252424
var canvas = findCanvasEventTarget(target);
24262425
if (!canvas) return {{{ cDefs.EMSCRIPTEN_RESULT_UNKNOWN_TARGET }}};
@@ -2436,7 +2435,7 @@ var LibraryHTML5 = {
24362435
$setCanvasElementSize__deps: ['emscripten_set_canvas_element_size', '$withStackSave', '$stringToUTF8OnStack'],
24372436
$setCanvasElementSize: function(target, width, height) {
24382437
#if GL_DEBUG
2439-
dbg('setCanvasElementSize(target='+target+',width='+width+',height='+height);
2438+
dbg(`setCanvasElementSize(target=${target},width=${width},height=${height}`);
24402439
#endif
24412440
if (!target.controlTransferredOffscreen) {
24422441
target.width = width;

src/library_html5_webgl.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ var LibraryHtml5WebGL = {
117117
// then this can be avoided, since OffscreenCanvas enables explicit swap control.
118118
#if GL_DEBUG
119119
if (contextAttributes.proxyContextToMainThread === {{{ cDefs.EMSCRIPTEN_WEBGL_CONTEXT_PROXY_ALWAYS }}}) dbg('EMSCRIPTEN_WEBGL_CONTEXT_PROXY_ALWAYS enabled, proxying WebGL rendering from pthread to main thread.');
120-
if (!canvas && contextAttributes.proxyContextToMainThread === {{{ cDefs.EMSCRIPTEN_WEBGL_CONTEXT_PROXY_FALLBACK }}}) dbg('Specified canvas target "' + targetStr + '" is not an OffscreenCanvas in the current pthread, but EMSCRIPTEN_WEBGL_CONTEXT_PROXY_FALLBACK is set. Proxying WebGL rendering from pthread to main thread.');
120+
if (!canvas && contextAttributes.proxyContextToMainThread === {{{ cDefs.EMSCRIPTEN_WEBGL_CONTEXT_PROXY_FALLBACK }}}) dbg(`Specified canvas target "${targetStr}" is not an OffscreenCanvas in the current pthread, but EMSCRIPTEN_WEBGL_CONTEXT_PROXY_FALLBACK is set. Proxying WebGL rendering from pthread to main thread.`);
121121
dbg('Performance warning: forcing renderViaOffscreenBackBuffer=true and preserveDrawingBuffer=true since proxying WebGL rendering.');
122122
#endif
123123
// We will be proxying - if OffscreenCanvas is supported, we can proxy a bit more efficiently by avoiding having to create an Offscreen FBO.
@@ -132,7 +132,7 @@ var LibraryHtml5WebGL = {
132132

133133
if (!canvas) {
134134
#if GL_DEBUG
135-
dbg('emscripten_webgl_create_context failed: Unknown canvas target "' + targetStr + '"!');
135+
dbg(`emscripten_webgl_create_context failed: Unknown canvas target "${targetStr}"!`);
136136
#endif
137137
return 0;
138138
}
@@ -141,8 +141,8 @@ var LibraryHtml5WebGL = {
141141
if (canvas.offscreenCanvas) canvas = canvas.offscreenCanvas;
142142

143143
#if GL_DEBUG
144-
if (typeof OffscreenCanvas != 'undefined' && canvas instanceof OffscreenCanvas) dbg('emscripten_webgl_create_context: Creating an OffscreenCanvas-based WebGL context on target "' + targetStr + '"');
145-
else if (typeof HTMLCanvasElement != 'undefined' && canvas instanceof HTMLCanvasElement) dbg('emscripten_webgl_create_context: Creating an HTMLCanvasElement-based WebGL context on target "' + targetStr + '"');
144+
if (typeof OffscreenCanvas != 'undefined' && canvas instanceof OffscreenCanvas) dbg(`emscripten_webgl_create_context: Creating an OffscreenCanvas-based WebGL context on target "${targetStr}"`);
145+
else if (typeof HTMLCanvasElement != 'undefined' && canvas instanceof HTMLCanvasElement) dbg(`emscripten_webgl_create_context: Creating an HTMLCanvasElement-based WebGL context on target "${targetStr}"`);
146146
#endif
147147

148148
if (contextAttributes.explicitSwapControl) {
@@ -166,7 +166,7 @@ var LibraryHtml5WebGL = {
166166

167167
if (canvas.transferControlToOffscreen) {
168168
#if GL_DEBUG
169-
dbg('explicitSwapControl requested: canvas.transferControlToOffscreen() on canvas "' + targetStr + '" to get .commit() function and not rely on implicit WebGL swap');
169+
dbg(`explicitSwapControl requested: canvas.transferControlToOffscreen() on canvas "${targetStr}" to get .commit() function and not rely on implicit WebGL swap`);
170170
#endif
171171
if (!canvas.controlTransferredOffscreen) {
172172
GL.offscreenCanvases[canvas.id] = {
@@ -177,7 +177,7 @@ var LibraryHtml5WebGL = {
177177
canvas.controlTransferredOffscreen = true;
178178
} else if (!GL.offscreenCanvases[canvas.id]) {
179179
#if GL_DEBUG
180-
dbg('OffscreenCanvas is supported, and canvas "' + canvas.id + '" has already before been transferred offscreen, but there is no known OffscreenCanvas with that name!');
180+
dbg(`OffscreenCanvas is supported, and canvas "${canvas.id}" has already before been transferred offscreen, but there is no known OffscreenCanvas with that name!`);
181181
#endif
182182
return 0;
183183
}
@@ -248,7 +248,7 @@ var LibraryHtml5WebGL = {
248248
emscripten_webgl_do_commit_frame: function() {
249249
#if TRACE_WEBGL_CALLS
250250
var threadId = (typeof _pthread_self != 'undefined') ? _pthread_self : function() { return 1; };
251-
err('[Thread ' + threadId() + ', GL ctx: ' + GL.currentContext.handle + ']: emscripten_webgl_do_commit_frame()');
251+
err(`[Thread ${threadId()}, GL ctx: ${GL.currentContext.handle}]: emscripten_webgl_do_commit_frame()`);
252252
#endif
253253
if (!GL.currentContext || !GL.currentContext.GLctx) {
254254
#if GL_DEBUG

src/library_openal.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ var LibraryOpenAL = {
747747
getGlobalParam: function(funcname, param) {
748748
if (!AL.currentCtx) {
749749
#if OPENAL_DEBUG
750-
dbg(funcname + '() called without a valid context');
750+
dbg(`${funcname}() called without a valid context`);
751751
#endif
752752
return null;
753753
}
@@ -761,7 +761,7 @@ var LibraryOpenAL = {
761761
return AL.currentCtx.distanceModel;
762762
default:
763763
#if OPENAL_DEBUG
764-
dbg(`${funcname}() param ${ptrToString(param}`) + ' is unknown or not implemented');
764+
dbg(`${funcname}() param ${ptrToString(param} is unknown or not implemented`);
765765
#endif
766766
AL.currentCtx.err = {{{ cDefs.AL_INVALID_ENUM }}};
767767
return null;
@@ -771,7 +771,7 @@ var LibraryOpenAL = {
771771
setGlobalParam: function(funcname, param, value) {
772772
if (!AL.currentCtx) {
773773
#if OPENAL_DEBUG
774-
dbg(funcname + '() called without a valid context');
774+
dbg(`${funcname}() called without a valid context`);
775775
#endif
776776
return;
777777
}
@@ -833,7 +833,7 @@ var LibraryOpenAL = {
833833
getListenerParam: function(funcname, param) {
834834
if (!AL.currentCtx) {
835835
#if OPENAL_DEBUG
836-
dbg(funcname + '() called without a valid context');
836+
dbg(`${funcname}() called without a valid context`);
837837
#endif
838838
return null;
839839
}
@@ -859,7 +859,7 @@ var LibraryOpenAL = {
859859
setListenerParam: function(funcname, param, value) {
860860
if (!AL.currentCtx) {
861861
#if OPENAL_DEBUG
862-
dbg(funcname + '() called without a valid context');
862+
dbg(`${funcname}() called without a valid context`);
863863
#endif
864864
return;
865865
}
@@ -943,14 +943,14 @@ var LibraryOpenAL = {
943943
getBufferParam: function(funcname, bufferId, param) {
944944
if (!AL.currentCtx) {
945945
#if OPENAL_DEBUG
946-
dbg(funcname + '() called without a valid context');
946+
dbg(`${funcname}() called without a valid context`);
947947
#endif
948948
return;
949949
}
950950
var buf = AL.buffers[bufferId];
951951
if (!buf || bufferId === 0) {
952952
#if OPENAL_DEBUG
953-
dbg(funcname + '() called with an invalid buffer');
953+
dbg(`${funcname}() called with an invalid buffer`);
954954
#endif
955955
AL.currentCtx.err = {{{ cDefs.AL_INVALID_NAME }}};
956956
return;
@@ -985,14 +985,14 @@ var LibraryOpenAL = {
985985
setBufferParam: function(funcname, bufferId, param, value) {
986986
if (!AL.currentCtx) {
987987
#if OPENAL_DEBUG
988-
dbg(funcname + '() called without a valid context');
988+
dbg(`${funcname}() called without a valid context`);
989989
#endif
990990
return;
991991
}
992992
var buf = AL.buffers[bufferId];
993993
if (!buf || bufferId === 0) {
994994
#if OPENAL_DEBUG
995-
dbg(funcname + '() called with an invalid buffer');
995+
dbg(`${funcname}() called with an invalid buffer`);
996996
#endif
997997
AL.currentCtx.err = {{{ cDefs.AL_INVALID_NAME }}};
998998
return;
@@ -1027,7 +1027,7 @@ var LibraryOpenAL = {
10271027
}
10281028
if (buf.refCount > 0) {
10291029
#if OPENAL_DEBUG
1030-
dbg(funcname + '() param AL_LOOP_POINTS_SOFT set on bound buffer');
1030+
dbg(`${funcname}() param AL_LOOP_POINTS_SOFT set on bound buffer`);
10311031
#endif
10321032
AL.currentCtx.err = {{{ cDefs.AL_INVALID_OPERATION }}};
10331033
return;
@@ -1050,14 +1050,14 @@ var LibraryOpenAL = {
10501050
getSourceParam: function(funcname, sourceId, param) {
10511051
if (!AL.currentCtx) {
10521052
#if OPENAL_DEBUG
1053-
dbg(funcname + '() called without a valid context');
1053+
dbg(`${funcname}() called without a valid context`);
10541054
#endif
10551055
return null;
10561056
}
10571057
var src = AL.currentCtx.sources[sourceId];
10581058
if (!src) {
10591059
#if OPENAL_DEBUG
1060-
dbg(funcname + '() called with an invalid source');
1060+
dbg(`${funcname}() called with an invalid source`);
10611061
#endif
10621062
AL.currentCtx.err = {{{ cDefs.AL_INVALID_NAME }}};
10631063
return null;
@@ -1161,7 +1161,7 @@ var LibraryOpenAL = {
11611161
setSourceParam: function(funcname, sourceId, param, value) {
11621162
if (!AL.currentCtx) {
11631163
#if OPENAL_DEBUG
1164-
dbg(funcname + '() called without a valid context');
1164+
dbg(`${funcname}() called without a valid context`);
11651165
#endif
11661166
return;
11671167
}
@@ -1312,7 +1312,7 @@ var LibraryOpenAL = {
13121312
case 0x1009 /* AL_BUFFER */:
13131313
if (src.state === {{{ cDefs.AL_PLAYING }}} || src.state === {{{ cDefs.AL_PAUSED }}}) {
13141314
#if OPENAL_DEBUG
1315-
dbg(funcname + '(AL_BUFFER) called while source is playing or paused');
1315+
dbg(`${funcname}(AL_BUFFER) called while source is playing or paused`);
13161316
#endif
13171317
AL.currentCtx.err = {{{ cDefs.AL_INVALID_OPERATION }}};
13181318
return;
@@ -1511,7 +1511,7 @@ var LibraryOpenAL = {
15111511
case 0x200A /* AL_SAMPLE_LENGTH_SOFT */:
15121512
case 0x200B /* AL_SEC_LENGTH_SOFT */:
15131513
#if OPENAL_DEBUG
1514-
dbg(funcname + '() param AL_*_LENGTH_SOFT is read only');
1514+
dbg(`${funcname}() param AL_*_LENGTH_SOFT is read only`);
15151515
#endif
15161516
AL.currentCtx.err = {{{ cDefs.AL_INVALID_OPERATION }}};
15171517
break;
@@ -1539,7 +1539,7 @@ var LibraryOpenAL = {
15391539
break;
15401540
default:
15411541
#if OPENAL_DEBUG
1542-
dbg(`${funcname}() param ${ptrToString(param)}' is unknown or not implemented`);
1542+
dbg(`${funcname}() param ${ptrToString(param)} is unknown or not implemented`);
15431543
#endif
15441544
AL.currentCtx.err = {{{ cDefs.AL_INVALID_ENUM }}};
15451545
return;
@@ -1622,7 +1622,7 @@ var LibraryOpenAL = {
16221622
resolvedDeviceName = UTF8ToString(pDeviceName);
16231623
if (resolvedDeviceName !== AL.CAPTURE_DEVICE_NAME) {
16241624
#if OPENAL_DEBUG
1625-
dbg('alcCaptureOpenDevice() with invalid device name \''+resolvedDeviceName+'\'');
1625+
dbg(`alcCaptureOpenDevice() with invalid device name '${resolvedDeviceName}'`);
16261626
#endif
16271627
// ALC_OUT_OF_MEMORY
16281628
// From the programmer's guide, ALC_OUT_OF_MEMORY's meaning is
@@ -2015,7 +2015,7 @@ var LibraryOpenAL = {
20152015
case 'u8' : setSample = setU8Sample ; break;
20162016
default:
20172017
#if OPENAL_DEBUG
2018-
dbg('Internal error: Unknown sample type \''+c.requestedSampleType+'\'');
2018+
dbg(`Internal error: Unknown sample type '${c.requestedSampleType}'`);
20192019
#endif
20202020
return;
20212021
}

src/library_pthread.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1188,7 +1188,7 @@ var LibraryPThread = {
11881188
}
11891189

11901190
#if PTHREADS_DEBUG
1191-
dbg('_emscripten_dlsync_threads_async: waiting on ' + promises.length + ' promises');
1191+
dbg(`_emscripten_dlsync_threads_async: waiting on ${promises.length} promises`);
11921192
#endif
11931193
// Once all promises are resolved then we know all threads are in sync and
11941194
// we can call the callback.

src/library_syscall.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,14 @@ var SyscallsLibrary = {
100100
SYSCALLS.varargs += 4;
101101
var ret = {{{ makeGetValue('SYSCALLS.varargs', '-4', 'i32') }}};
102102
#if SYSCALL_DEBUG
103-
dbg(' (raw: "' + ret + '")');
103+
dbg(` (raw: "${ret}")`);
104104
#endif
105105
return ret;
106106
},
107107
getStr: function(ptr) {
108108
var ret = UTF8ToString(ptr);
109109
#if SYSCALL_DEBUG
110-
dbg(' (str: "' + ret + '")');
110+
dbg(` (str: "${ret}")`);
111111
#endif
112112
return ret;
113113
},
@@ -117,7 +117,7 @@ var SyscallsLibrary = {
117117
var stream = FS.getStream(fd);
118118
if (!stream) throw new FS.ErrnoError({{{ cDefs.EBADF }}});
119119
#if SYSCALL_DEBUG
120-
dbg(' (stream: "' + stream.path + '")');
120+
dbg(` (stream: "${stream.path}")`);
121121
#endif
122122
return stream;
123123
},
@@ -277,7 +277,7 @@ var SyscallsLibrary = {
277277
var socket = SOCKFS.getSocket(fd);
278278
if (!socket) throw new FS.ErrnoError({{{ cDefs.EBADF }}});
279279
#if SYSCALL_DEBUG
280-
dbg(' (socket: "' + socket.path + '")');
280+
dbg(` (socket: "${socket.path}")`);
281281
#endif
282282
return socket;
283283
},
@@ -419,13 +419,13 @@ var SyscallsLibrary = {
419419
// concatenate scatter-gather arrays into one message buffer
420420
var total = 0;
421421
for (var i = 0; i < num; i++) {
422-
total += {{{ makeGetValue('iov', '(' + C_STRUCTS.iovec.__size__ + ' * i) + ' + C_STRUCTS.iovec.iov_len, 'i32') }}};
422+
total += {{{ makeGetValue('iov', `(${C_STRUCTS.iovec.__size__} * i) + ${C_STRUCTS.iovec.iov_len}`, 'i32') }}};
423423
}
424424
var view = new Uint8Array(total);
425425
var offset = 0;
426426
for (var i = 0; i < num; i++) {
427-
var iovbase = {{{ makeGetValue('iov', '(' + C_STRUCTS.iovec.__size__ + ' * i) + ' + C_STRUCTS.iovec.iov_base, POINTER_TYPE) }}};
428-
var iovlen = {{{ makeGetValue('iov', '(' + C_STRUCTS.iovec.__size__ + ' * i) + ' + C_STRUCTS.iovec.iov_len, 'i32') }}};
427+
var iovbase = {{{ makeGetValue('iov', `(${C_STRUCTS.iovec.__size__} * i) + ${C_STRUCTS.iovec.iov_base}`, POINTER_TYPE) }}};
428+
var iovlen = {{{ makeGetValue('iov', `(${C_STRUCTS.iovec.__size__} * i) + ${C_STRUCTS.iovec.iov_len}`, 'i32') }}};
429429
for (var j = 0; j < iovlen; j++) {
430430
view[offset++] = {{{ makeGetValue('iovbase', 'j', 'i8') }}};
431431
}
@@ -441,7 +441,7 @@ var SyscallsLibrary = {
441441
// get the total amount of data we can read across all arrays
442442
var total = 0;
443443
for (var i = 0; i < num; i++) {
444-
total += {{{ makeGetValue('iov', '(' + C_STRUCTS.iovec.__size__ + ' * i) + ' + C_STRUCTS.iovec.iov_len, 'i32') }}};
444+
total += {{{ makeGetValue('iov', `(${C_STRUCTS.iovec.__size__} * i) + ${C_STRUCTS.iovec.iov_len}`, 'i32') }}};
445445
}
446446
// try to read total data
447447
var msg = sock.sock_ops.recvmsg(sock, total);
@@ -467,8 +467,8 @@ var SyscallsLibrary = {
467467
var bytesRead = 0;
468468
var bytesRemaining = msg.buffer.byteLength;
469469
for (var i = 0; bytesRemaining > 0 && i < num; i++) {
470-
var iovbase = {{{ makeGetValue('iov', '(' + C_STRUCTS.iovec.__size__ + ' * i) + ' + C_STRUCTS.iovec.iov_base, POINTER_TYPE) }}};
471-
var iovlen = {{{ makeGetValue('iov', '(' + C_STRUCTS.iovec.__size__ + ' * i) + ' + C_STRUCTS.iovec.iov_len, 'i32') }}};
470+
var iovbase = {{{ makeGetValue('iov', `(${C_STRUCTS.iovec.__size__} * i) + ${C_STRUCTS.iovec.iov_base}`, POINTER_TYPE) }}};
471+
var iovlen = {{{ makeGetValue('iov', `(${C_STRUCTS.iovec.__size__} * i) + ${C_STRUCTS.iovec.iov_len}`, 'i32') }}};
472472
if (!iovlen) {
473473
continue;
474474
}
@@ -744,7 +744,7 @@ var SyscallsLibrary = {
744744
return -1;
745745
default: {
746746
#if SYSCALL_DEBUG
747-
dbg('warning: fcntl unrecognized command ' + cmd);
747+
dbg(`warning: fcntl unrecognized command ${cmd}`);
748748
#endif
749749
return -{{{ cDefs.EINVAL }}};
750750
}
@@ -839,7 +839,7 @@ var SyscallsLibrary = {
839839
var allowEmpty = flags & {{{ cDefs.AT_EMPTY_PATH }}};
840840
flags = flags & (~{{{ cDefs.AT_SYMLINK_NOFOLLOW | cDefs.AT_EMPTY_PATH | cDefs.AT_NO_AUTOMOUNT }}});
841841
#if ASSERTIONS
842-
assert(!flags, 'unknown flags in __syscall_newfstatat: ' + flags);
842+
assert(!flags, `unknown flags in __syscall_newfstatat: ${flags}`);
843843
#endif
844844
path = SYSCALLS.calculateAt(dirfd, path, allowEmpty);
845845
return SYSCALLS.doStat(nofollow ? FS.lstat : FS.stat, path, buf);

0 commit comments

Comments
 (0)