diff options
author | Alon Zakai <alonzakai@gmail.com> | 2017-03-24 15:45:31 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-24 15:45:31 -0700 |
commit | f1c992f946438ba8785c418e769ee024606fdde0 (patch) | |
tree | a2c91c8e21fdddbc22e9455f2c180f446fa4bf70 /test/binaryen.js/test.js | |
parent | 7b71bb6b0d3966ce42b631d433c772e24d6e68be (diff) | |
download | binaryen-f1c992f946438ba8785c418e769ee024606fdde0.tar.gz binaryen-f1c992f946438ba8785c418e769ee024606fdde0.tar.bz2 binaryen-f1c992f946438ba8785c418e769ee024606fdde0.zip |
New binaryen.js (#922)
New binaryen.js implementation, based on the C API underneath and with a JS-friendly API on top. See docs under docs/ for API details.
Diffstat (limited to 'test/binaryen.js/test.js')
-rw-r--r-- | test/binaryen.js/test.js | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/test/binaryen.js/test.js b/test/binaryen.js/test.js deleted file mode 100644 index 3b6d9471b..000000000 --- a/test/binaryen.js/test.js +++ /dev/null @@ -1,44 +0,0 @@ - -Binaryen = Binaryen(); // instantiate the module - -var input = - '(module\n' + - ' (export "add" $add)\n' + - ' (func $add (param $x f64) (param $y f64) (result f64)\n' + - ' (f64.add\n' + - ' (get_local $x)\n' + - ' (get_local $y)\n' + - ' )\n' + - ' )\n' + - ')\n'; - -console.log('input:'); -console.log(input); -console.log('================'); - -var module = new Binaryen.Module(); -var parser = new Binaryen.SExpressionParser(input); - -console.log('s-expr dump:'); -parser.get_root().dump(); -var s_module = parser.get_root().getChild(0); -console.log('================'); - -var builder = new Binaryen.SExpressionWasmBuilder(module, s_module); - -console.log('module:'); -Binaryen.WasmPrinter.prototype.printModule(module); -console.log('================'); - -var interface_ = new Binaryen.ShellExternalInterface(); -var instance = new Binaryen.ModuleInstance(module, interface_); - -var name = new Binaryen.Name('add'); -console.log('name: ' + name.c_str()); - -var args = new Binaryen.LiteralList(); -args.push_back(new Binaryen.Literal(40)); -args.push_back(new Binaryen.Literal(2)); - -console.log('answer is ' + instance.callExport(name, args).getf64() + '.'); - |