wasm_exec icon indicating copy to clipboard operation
wasm_exec copied to clipboard

allow namespaces

Open chris-aeviator opened this issue 1 year ago • 1 comments

the original exec comes with a handy namespace. it allows for the addition of trusted extra code

     # Dictionary to store definitions from the script
    script_namespace = {'myFunction': myFunction}

    # Execute the script within the module's namespace
    exec(script_content, script_namespace)

it would be handy to allow for extra functions to be imported within the execution context

chris-aeviator avatar Jan 20 '24 16:01 chris-aeviator

Hmmmm. I'm not certain as to how implement this. I believe the args passed to the WASM execution environment are converted to string representations. I'll take a look at this further. Thanks for opening this!

Jflick58 avatar Jan 24 '24 16:01 Jflick58