Module.Runtime.addFunction no longer available

432 views
Skip to first unread message

tqc...@cs.washington.edu

unread,
Dec 30, 2017, 9:05:24 AM12/30/17
to emscripten-discuss
Hi
  
  However, in the latest update seems there are changes and Module.Runtime.addFunction is no longer available. I tried to add 'Runtime' to EXTRA_EXPORTED_RUNTIME_METHODS but seems the field is undefined. Is there any way to get handle of this from the javascript side?

Thanks very much!
Tianqi

Alon Zakai

unread,
Dec 30, 2017, 11:31:21 AM12/30/17
to emscripten-discuss
Sorry about this, this is because of a recent refactoring to the Runtime object. The fix should just be removing the "Runtime." prefix, as those functions are now just regular top-level JS functions. I added more documentation on this now in the FAQ,


We also mention this in the changelog, and an explanation is shown in -O0 builds or builds with ASSERTIONS enabled. Aside from those places and the FAQ, is there somewhere else we should mention this?

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tianqi Chen

unread,
Dec 30, 2017, 8:18:13 PM12/30/17
to emscripte...@googlegroups.com
Thanks for the answer. I also tried using Module.addFunction and also exported the function using -s EXPORTED_RUNTIME_METHODS="['getValue','setValue', 'cwrap', 'addFunction'].  
But addFunction is still not available in Module(we can get other functions like Module.getValue). Is this function get renamed or removed during refactoring? 


Tianqi

To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "emscripten-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/emscripten-discuss/B6sGcSPyX7g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to emscripten-discuss+unsub...@googlegroups.com.

Alon Zakai

unread,
Dec 30, 2017, 11:01:21 PM12/30/17
to emscripten-discuss
Sorry, yeah, that was a bug - during the refactoring I didn't add in support for exporting those methods, and we didn't have tests to catch it. A fix is in



To unsubscribe from this group and all its topics, send an email to emscripten-discuss+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsub...@googlegroups.com.

Tianqi Chen

unread,
Dec 31, 2017, 3:17:17 AM12/31/17
to emscripte...@googlegroups.com
awesome, thanks so much !

Tianqi

To unsubscribe from this group and all its topics, send an email to emscripten-discuss+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages