You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/library_pthread.js
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -75,7 +75,7 @@ var LibraryPThread = {
75
75
){
76
76
t=_pthread_self();
77
77
}
78
-
return'w:'+workerID+',t:'+ptrToString(t)+': ';
78
+
return`w:${workerID},t:${ptrToString(t)}: `;
79
79
}
80
80
81
81
// Prefix all err()/dbg() messages with the calling thread ID.
@@ -411,7 +411,7 @@ var LibraryPThread = {
411
411
#if EXPORT_ES6&&USE_ES6_IMPORT_META
412
412
// If we're using module output, use bundler-friendly pattern.
413
413
#if PTHREADS_DEBUG
414
-
dbg('Allocating a new web worker from '+import.meta.url);
414
+
dbg(`Allocating a new web worker from ${import.meta.url}`);
415
415
#endif
416
416
#if TRUSTED_TYPES
417
417
// Use Trusted Types compatible wrappers.
@@ -723,10 +723,10 @@ var LibraryPThread = {
723
723
#endif
724
724
725
725
var offscreenCanvases = {}; // Dictionary of OffscreenCanvas objects we'll transfer to the created thread to own
726
-
var moduleCanvasId = Module['canvas'] ? Module['canvas'].id : '';
726
+
var moduleCanvasId = Module['canvas']?.id || '';
727
727
// Note that transferredCanvasNames might be null (so we cannot do a for-of loop).
728
-
for (var i in transferredCanvasNames) {
729
-
var name = transferredCanvasNames[i].trim();
728
+
for (var name of transferredCanvasNames) {
729
+
name = name.trim();
730
730
var offscreenCanvasInfo;
731
731
try {
732
732
if (name == '#canvas') {
@@ -758,7 +758,7 @@ var LibraryPThread = {
758
758
}
759
759
if (canvas.transferControlToOffscreen) {
760
760
#if GL_DEBUG
761
-
dbg('pthread_create: canvas.transferControlToOffscreen(), transferring canvas by name "' + name + '" (DOM id="' + canvas.id + '") from main thread to pthread');
0 commit comments