Script-format-01.js (505B)
1 // |jit-test| skip-if: !wasmDebuggingEnabled() 2 3 // Tests that JavaScript scripts have a "js" format and wasm scripts have a 4 // "wasm" format. 5 6 var g = newGlobal({newCompartment: true}); 7 var dbg = new Debugger(g); 8 9 var gotScript; 10 dbg.onNewScript = (script) => { 11 gotScript = script; 12 }; 13 14 g.eval(`(() => {})()`); 15 assertEq(gotScript.format, "js"); 16 17 g.eval(`o = new WebAssembly.Instance(new WebAssembly.Module(wasmTextToBinary('(module (func) (export "" (func 0)))')));`); 18 assertEq(gotScript.format, "wasm");