Releases: localyost3000/tectonica
VM:0.0.4
@tectonica/vm v0.0.4
Isolate the marshaling/unmarshaling logic into a separate context to avoid polluting the global with required functions and maps.
Full Changelog: vm_0.0.3...vm_0.0.4
VM:0.0.2-3
@tectonica/vm v0.0.3
code cleanup and support for specifying a custom quickjs-emscripten variant to handle bundlers which move the .wasm file around. May add more built-in support for quickjs-ng variants in the future
@tectonica/vm v0.0.2
no changes, simply a re-publish with corrected assets
Full Changelog: vm_0.0.1...vm_0.0.3
VM:0.0.1
@tectonica/vm v0.0.1
Introducing the tectonica vm. Powered by quickjs-emscripten, this VM allows execution of arbitrary js in a sandboxed WASM-based VM. This initial release includes 2 primary methods:
registerVMGlobal(key: string, value: any)
This will attempt to create a copy of any value you provide it, and hoist it as a global inside the VM at the key specified. For example, by default the library registers a copy of the console
stdlib with the key console
so that executions inside the VM can be debugged via the terminal
eval(code: string)
This executes arbitrary js code inside the VM. It can access any other data you've registered in the VM, but nothing else from the browser environment.
Currently, the VM supports all regular JS datatypes (including promises) but there are a couple limitations. Functions are always globally-"this"-ed, so non-static functions may not work yet. Additionally, JS objects with non-enumerable keys will not have those keys copied automatically. Both of these limitations have planned fixes, but for now, please construct your objects using enumerable keys.
In coming releases, more methods and configurations will be added to even more fully control the WASM sandbox environment.