Skip to content

Commit 35c50dc

Browse files
authored
Revert "Modernize JS usage in library_pthread.js. NFC (#22545)"
This reverts commit 8800faa.
1 parent 52cc139 commit 35c50dc

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/library_pthread.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ var LibraryPThread = {
7575
) {
7676
t = _pthread_self();
7777
}
78-
return `w:${workerID},t:${ptrToString(t)}: `;
78+
return 'w:' + workerID + ',t:' + ptrToString(t) + ': ';
7979
}
8080

8181
// Prefix all err()/dbg() messages with the calling thread ID.
@@ -411,7 +411,7 @@ var LibraryPThread = {
411411
#if EXPORT_ES6 && USE_ES6_IMPORT_META
412412
// If we're using module output, use bundler-friendly pattern.
413413
#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);
415415
#endif
416416
#if TRUSTED_TYPES
417417
// Use Trusted Types compatible wrappers.
@@ -723,10 +723,10 @@ var LibraryPThread = {
723723
#endif
724724
725725
var offscreenCanvases = {}; // Dictionary of OffscreenCanvas objects we'll transfer to the created thread to own
726-
var moduleCanvasId = Module['canvas']?.id || '';
726+
var moduleCanvasId = Module['canvas'] ? Module['canvas'].id : '';
727727
// Note that transferredCanvasNames might be null (so we cannot do a for-of loop).
728-
for (var name of transferredCanvasNames) {
729-
name = name.trim();
728+
for (var i in transferredCanvasNames) {
729+
var name = transferredCanvasNames[i].trim();
730730
var offscreenCanvasInfo;
731731
try {
732732
if (name == '#canvas') {
@@ -758,7 +758,7 @@ var LibraryPThread = {
758758
}
759759
if (canvas.transferControlToOffscreen) {
760760
#if GL_DEBUG
761-
dbg(`pthread_create: canvas.transferControlToOffscreen(), transferring canvas by name "${name}" (DOM id="${canvas.id}") from main thread to pthread`);
761+
dbg('pthread_create: canvas.transferControlToOffscreen(), transferring canvas by name "' + name + '" (DOM id="' + canvas.id + '") from main thread to pthread');
762762
#endif
763763
// Create a shared information block in heap so that we can control
764764
// the canvas size from any thread.

0 commit comments

Comments
 (0)