mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-28 22:21:50 +00:00
Integrate examples into tests
This commit is contained in:
@ -6,10 +6,10 @@ An AssemblyScript example.
|
||||
Instructions
|
||||
------------
|
||||
|
||||
To build `assembly/i64.ts` to `i64.wasm`, run:
|
||||
To build [assembly/i64.ts](./assembly/i64.ts) to an untouched and an optimized `.wasm` including their respective `.wast` representations, run:
|
||||
|
||||
```
|
||||
$> npm run build
|
||||
```
|
||||
|
||||
Afterwards, `require` the node module as usual (entry point is `index.js`).
|
||||
Afterwards, `require` the node module as usual (CommonJS entry point is [index.js](./index.js)).
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
||||
var fs = require("fs");
|
||||
|
||||
// Instantiate the module
|
||||
var mod = new WebAssembly.Module(fs.readFileSync(__dirname + "/i64.wasm"));
|
||||
var mod = new WebAssembly.Module(fs.readFileSync(__dirname + "/i64.optimized.wasm"));
|
||||
var ins = new WebAssembly.Instance(mod, { /* no imports */ });
|
||||
|
||||
// Export its exports
|
||||
|
@ -3,6 +3,8 @@
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "asc assembly/i64.ts -t assembly/i64.wast -c && asc assembly/i64.ts -b i64.wasm -t assembly/i64.optimized.wast -O -c"
|
||||
"build": "npm run build:untouched && npm run build:optimized",
|
||||
"build:untouched": "asc assembly/i64.ts -t i64.untouched.wast -b i64.untouched.wasm --validate",
|
||||
"build:optimized": "asc -O assembly/i64.ts -b i64.optimized.wasm -t i64.optimized.wast --validdate"
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user