controlflow.js 666 B

123456789101112131415
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft Corporation and contributors. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. var mod = new WebAssembly.Module(readbuffer('controlflow.wasm'));
  6. var a = new WebAssembly.Instance(mod).exports;
  7. print(a.a(0));
  8. print(a.a(1));
  9. print(a.yield_top(0))
  10. print(a.yield_top(1))
  11. print(a.br_if(0))
  12. print(a.br_if(1))
  13. print(a.br())
  14. print(a.block())