badfuncformat.js 810 B

123456789101112131415161718
  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 wasmCode = new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,127,3,2,1,0,5,4,1,1,0,0,7,5,1,1,102,0,0,10,6,1,4,0,0,11,11,0,11,4,110,97,109,101,1,4,1,0,1,102]);
  6. var wasmModule = new WebAssembly.Module(wasmCode);
  7. var wasmInstance = new WebAssembly.Instance(wasmModule, {});
  8. let threw = false;
  9. try
  10. {
  11. wasmInstance.exports.f();
  12. }
  13. catch(e)
  14. {
  15. threw = true;
  16. }
  17. print(threw ? "Pass" : "Fail");