Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F4440101
wasm.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
521 B
Referenced Files
None
Subscribers
None
wasm.js
View Options
import
{
buildWasm
}
from
'./build'
;
const
i32
=
0x7f
;
const
local_get
=
i
=>
[
0x20
,
i
];
const
i32_add
=
[
0x6a
];
const
wasmBytes
=
buildWasm
({
types
:
[[[
i32
,
i32
],
[
i32
]]],
funcs
:
[{
body
:
[...
local_get
(
0
),
...
local_get
(
1
),
...
i32_add
]
}],
exports
:
[[
'add'
,
0x00
,
0
]]
});
console
.
log
(
`compiled to
${
wasmBytes
.
length
}
bytes\n`
);
const
{
instance
}
=
await
WebAssembly
.
instantiate
(
wasmBytes
);
console
.
log
(
'add(2, 3) ='
,
instance
.
exports
.
add
(
2
,
3
));
console
.
log
(
'add(100, 200) ='
,
instance
.
exports
.
add
(
100
,
200
));
File Metadata
Details
Attached
Mime Type
application/javascript
Expires
Sat, May 2, 8:29 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
542194
Default Alt Text
wasm.js (521 B)
Attached To
Mode
rANT Ant
Attached
Detach File
Event Timeline
Log In to Comment