forked from emscripten-core/emscripten
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhello_world_wasm2js.js
More file actions
59 lines (57 loc) · 1.31 KB
/
hello_world_wasm2js.js
File metadata and controls
59 lines (57 loc) · 1.31 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
var b = Module, g = new function(a) {
this.buffer = new ArrayBuffer(65536 * a.initial);
}({
initial: 256,
maximum: 256
}), k = g.buffer, d = new Uint8Array(k), l = new TextDecoder("utf8"), m;
function c(a) {
this.exports = function(h) {
function n(f) {
f.set = function(e, p) {
this[e] = p;
};
f.get = function(e) {
return this[e];
};
return f;
}
return function(f) {
var e = f.a.a;
return {
b: function() {},
c: function(p, q) {
e(1024);
return 0;
},
d: n([])
};
}(h);
}(a);
}
(function(a, h) {
return {
then: function(n) {
n({
instance: new c(h)
});
}
};
})(b.wasm, {
a: {
a: a => {
var h = console, n = h.log;
if (a) {
for (var f = a + void 0, e = a; !(e >= f) && d[e]; ) ++e;
a = l.decode(d.subarray(a, e));
} else a = "";
n.call(h, a);
},
memory: g
}
}).then((a => {
a = a.instance.exports;
m = a.c;
d.set(new Uint8Array(b.mem), 1024);
a.b();
m();
}));