paullouisageneau / datachannel-wasm

C++ WebRTC Data Channels and WebSockets for WebAssembly in browsers
MIT License
148 stars 25 forks source link

Use dynCall instead of dynCall_sig in webrtc.js #9

Closed paullouisageneau closed 3 years ago

paullouisageneau commented 3 years ago

Follow up on https://github.com/paullouisageneau/datachannel-wasm/pull/8

hanseuljun commented 3 years ago

Thanks for covering this part, which I don't have code to test yet!

Unfortunately, one thing I need to mention is that, actually the change from dynCall_sig to dynCall has one more caveat. Now the parameters are not variadic but all inside an array. So, though I haven't tested this, I guess Module['dynCall_viii'](callback, pSdp, pType, userPointer); which became Module['dynCall']('viii', callback, pSdp, pType, userPointer); in this commit needs to become Module['dynCall']('viii', callback, [pSdp, pType, userPointer]);

paullouisageneau commented 3 years ago

You are right, I should have tested properly before merging! This is now fixed in https://github.com/paullouisageneau/datachannel-wasm/commit/3d1696ba529ca7e81b738eeb5e6a0f780a26cb25.