From 77435b08a41aad28344440ac83ef710345085d4b Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Wed, 25 Sep 2024 09:16:46 -0700 Subject: [PATCH] library_pthread.js: Ensure transferredCanvasNames is iterable This was first broken back in #17577 and then fixed in #17752. I then broke it again in #22545 (yay!) (see #22620). This time I will include a test to ensure this doesn't happen again. --- src/library_pthread.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/library_pthread.js b/src/library_pthread.js index 680a6ac9dd316..7b797d68d6f4a 100644 --- a/src/library_pthread.js +++ b/src/library_pthread.js @@ -716,8 +716,8 @@ var LibraryPThread = { transferredCanvasNames = '{{{ OFFSCREENCANVASES_TO_PTHREAD }}}'; } else #endif - transferredCanvasNames &&= UTF8ToString(transferredCanvasNames).trim(); - transferredCanvasNames &&= transferredCanvasNames.split(','); + // Note: UTF8ToString(0) will return the empty string. + transferredCanvasNames = UTF8ToString(transferredCanvasNames).trim().split(','; #if GL_DEBUG dbg(`pthread_create: transferredCanvasNames="${transferredCanvasNames}"`); #endif