In general it is nice to have code using Runtime.* be inside the code
optimized by closure. So put it in a --pre-js. And export that method on
Module, so that you can call it from outside.

But, you can also export individual parts of Runtime if you want to, as in
your example.

- Alon


On Thu, Mar 26, 2015 at 6:24 AM, zephon <[email protected]>
wrote:

> I'm using "Runtime.stackSave" and "Runtime.stackRestore" outside of my
> module, but when i'm compiling with -O2 -closure 1, Runtime is no more
> accessible. What is the fastest way to expose these functions anyway?
>
> Actually i'm dealing with it that way:
>
>    - In the compilation flags: --pre-js "pre.js"
>    - In that "pre.js" file:
>
> var Module = eval('Module') || {};
> Module['myStackSave'] = Runtime.stackSave;
> ...
>
>
> ...but i'm not sure it's the best way :S
>
>  --
> 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 [email protected].
> 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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to