feat: test script
This commit is contained in:
@@ -47,13 +47,16 @@ fn main() -> Result<()> {
|
|||||||
|store, module, linker| Exports::instantiate(store, module, linker, |cx| &mut cx.exports),
|
|store, module, linker| Exports::instantiate(store, module, linker, |cx| &mut cx.exports),
|
||||||
)?;
|
)?;
|
||||||
let a = exports.eval_javascript(&mut store, r##"
|
let a = exports.eval_javascript(&mut store, r##"
|
||||||
|
function hi(name) { return "hi: " + name; }
|
||||||
let a = [];
|
let a = [];
|
||||||
a.push(fetch('https://www.google.com/'));
|
a.push(fetch('https://www.google.com/'));
|
||||||
for (let i = 0; i < 3; i++) { a.push(i); }
|
for (let i = 0; i < 3; i++) { a.push(i); }
|
||||||
a.push({
|
a.push({
|
||||||
id: 1, name: 'hatter'
|
id: 1, name: 'hatter'
|
||||||
});
|
});
|
||||||
//JSON.stringify(a)
|
a.push(hi('001'));
|
||||||
|
a.push(hi('002'));
|
||||||
|
// JSON.stringify(a)
|
||||||
a
|
a
|
||||||
"##);
|
"##);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user