Support passing JS objects through Rust

This commit is contained in:
Alex Crichton
2017-12-19 09:25:41 -08:00
parent eda9beae25
commit 946e5317fe
9 changed files with 436 additions and 13 deletions

View File

@ -55,6 +55,8 @@ pub fn project() -> Project {
out.instantiate(wasm, test.imports).then(m => {
test.test(m);
if (m.assertHeapAndStackEmpty)
m.assertHeapAndStackEmpty();
}).catch(function(error) {
console.error(error);
process.exit(1);
@ -146,6 +148,7 @@ impl Project {
let obj = cli::Bindgen::new()
.input_path(&out)
.nodejs(true)
.debug(true)
.generate()
.expect("failed to run bindgen");
obj.write_js_to(root.join("out.js")).expect("failed to write js");