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
Make use of JS rest and spread operators throughout the codebase. NFC
Following up on emscripten-core#21270. These operators were introduced way before
our current default set of browser versions. Anyone targeting an
browser so old as to not support these will already be on the
transpilation path.
throwBindingError(`Function '${humanName}' called with an invalid number of arguments (${arguments.length}) - expects one of (${proto[methodName].overloadTable})!`);
throwBindingError(`Function '${humanName}' called with an invalid number of arguments (${args.length}) - expects one of (${proto[methodName].overloadTable})!`);
thrownewBindingError(`Tried to invoke ctor of ${name} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(registeredClass.constructor_body).toString()}) parameters instead!`);
1777
+
thrownewBindingError(`Tried to invoke ctor of ${name} with invalid number of parameters (${args.length}) - expected (${Object.keys(registeredClass.constructor_body).toString()}) parameters instead!`);
var ret = (function() { if (runtimeDebug) err("[library call:${mangled}: " + Array.prototype.slice.call(arguments).map(prettyPrint) + "]");
240
+
var ret = (function(...args) { if (runtimeDebug) err("[library call:${mangled}: " + args.map(prettyPrint) + "]");
241
241
${body}
242
-
}).apply(this, arguments);
242
+
}).call(this, ${args});
243
243
if (runtimeDebug && typeof ret != "undefined") err(" [ return:" + prettyPrint(ret));
244
244
return ret;
245
245
}`);
@@ -443,7 +443,7 @@ function(${args}) {
443
443
if(ASSERTIONS){
444
444
assertion+=`if (!${target} || ${target}.stub) abort("external symbol '${symbol}' is missing. perhaps a side module was not linked in? if this function was expected to arrive from a system library, try to build the MAIN_MODULE with EMCC_FORCE_STDLIBS=1 in the environment");\n`;
Copy file name to clipboardExpand all lines: src/library.js
+6-11
Original file line number
Diff line number
Diff line change
@@ -2874,7 +2874,7 @@ addToLibrary({
2874
2874
#if ASSERTIONS
2875
2875
assert(ASM_CONSTS.hasOwnProperty(code),`No EM_ASM constant found at address ${code}. The loaded WebAssembly file is likely out of sync with the generated JavaScript.`);
assert(ASM_CONSTS.hasOwnProperty(code),`No EM_ASM constant found at address ${code}. The loaded WebAssembly file is likely out of sync with the generated JavaScript.`);
Copy file name to clipboardExpand all lines: src/library_async.js
+5-5
Original file line number
Diff line number
Diff line change
@@ -68,10 +68,10 @@ addToLibrary({
68
68
}
69
69
#endif
70
70
#if ASSERTIONS&&ASYNCIFY!=2// We cannot apply assertions with stack switching, as the imports must not be modified from suspender.suspendOnReturnedPromise TODO find a way
71
-
imports[x]=function(){
71
+
imports[x]=(...args)=>{
72
72
varoriginalAsyncifyState=Asyncify.state;
73
73
try{
74
-
returnoriginal.apply(null,arguments);
74
+
returnoriginal(...args);
75
75
}finally{
76
76
// Only asyncify-declared imports are allowed to change the
0 commit comments