Skip to content

Commit f078532

Browse files
committed
Use rest and spread operators in multi-threaded code. NFC
These operators are available everywhere that we can run mutli-threaded code.
1 parent 97053db commit f078532

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/library.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2911,7 +2911,7 @@ addToLibrary({
29112911
// code paths as similar as possible on both sides.)
29122912
// -1 - code is the encoding of a proxied EM_ASM, as a negative number
29132913
// (positive numbers are non-EM_ASM calls).
2914-
return proxyToMainThread.apply(null, [-1 - code, sync].concat(args));
2914+
return proxyToMainThread(-1 - code, sync, ...args);
29152915
}
29162916
#endif
29172917
#if ASSERTIONS

src/library_pthread.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -957,8 +957,8 @@ var LibraryPThread = {
957957
#if MEMORY64
958958
// Calls proxyToMainThread but returns a bigint rather than a number
959959
$proxyToMainThreadPtr__deps: ['$proxyToMainThread'],
960-
$proxyToMainThreadPtr: function() {
961-
return BigInt(proxyToMainThread.apply(null, arguments));
960+
$proxyToMainThreadPtr: (...args) {
961+
return BigInt(proxyToMainThread(...args));
962962
},
963963
#endif
964964

0 commit comments

Comments
 (0)