-
-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathprimary-tests.js
46 lines (43 loc) · 1015 Bytes
/
primary-tests.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
global.globalObject1 = {
"prop_1": {
"nested_prop": 1,
},
"prop_2": 2,
"prop_3": true,
"prop_4": [
3, 4, "str_elm_1", null, undefined, 5,
],
"prop_5": {
"func1": function () { return },
"func2": function () { return 1 },
"func3": function (n) { return n * 2},
"func4": function (a, b, c) { return a + b + c },
"func5": function (x) { return "Hello, " + x },
"func6": function (c, a, b) {
if (c) { return a } else { return b }
},
},
"prop_6": {
"call_host_1": () => {
return global.globalObject1.prop_6.host_func_1()
}
},
"prop_7": 3.14,
"prop_8": [0, , 2, 3, , , 6],
}
global.Animal = function(name, age, isCat) {
this.name = name
this.age = age
this.bark = () => {
return isCat ? "nyan" : "wan"
}
this.isCat = isCat
this.getIsCat = function() {
return this.isCat
}
}
const { startWasiTask } = require("../lib")
startWasiTask("./dist/PrimaryTests.wasm").catch(err => {
console.log(err)
process.exit(1)
});