mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-04-25 07:02:13 +00:00
Fix and also unify ugc example, see #101
This commit is contained in:
parent
1f3bb61fae
commit
dae9880428
@ -9,7 +9,7 @@ Instructions
|
||||
To build [assembly/ugc.ts](./assembly/ugc.ts) to an untouched and an optimized `.wasm` including their respective `.wat` representations, run:
|
||||
|
||||
```
|
||||
$> npm run build
|
||||
$> npm run asbuild
|
||||
```
|
||||
|
||||
Afterwards, to run the included [test](./tests/index.js):
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -3,9 +3,9 @@
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "npm run build:untouched && npm run build:optimized",
|
||||
"build:untouched": "asc assembly/index.ts -b ugc.untouched.wasm -t ugc.untouched.wat --validate --sourceMap --measure",
|
||||
"build:optimized": "asc -O3 assembly/index.ts -b ugc.optimized.wasm -t ugc.optimized.wat --validate --noDebug --noAssert --sourceMap --measure",
|
||||
"asbuild": "npm run asbuild:untouched && npm run asbuild:optimized",
|
||||
"asbuild:untouched": "asc assembly/index.ts -b build/untouched.wasm -t build/untouched.wat --validate --sourceMap --measure",
|
||||
"asbuild:optimized": "asc -O3 assembly/index.ts -b build/optimized.wasm -t build/optimized.wat --validate --noDebug --noAssert --sourceMap --measure",
|
||||
"test": "node tests"
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,11 @@ var fs = require("fs");
|
||||
|
||||
// NOTE that this doesn't do anything useful, yet
|
||||
|
||||
var ugc = new WebAssembly.Instance(new WebAssembly.Module(fs.readFileSync(__dirname + "/../ugc.untouched.wasm"))).exports;
|
||||
var ugc = new WebAssembly.Instance(new WebAssembly.Module(fs.readFileSync(__dirname + "/../build/untouched.wasm")), {
|
||||
env: { abort: function(msg, file, line, column) {
|
||||
console.log("abort called at " + line + ":" + column);
|
||||
} }
|
||||
}).exports;
|
||||
|
||||
function mem(memory, offset, count) {
|
||||
if (!offset) offset = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user