bug1793935.any.js (852B)
1 // The module has an import that's immediately called by the start function. 2 const module = new Uint8Array([ 3 0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 4 0, 0, 2, 7, 1, 1, 97, 1, 98, 0, 0, 3, 5 2, 1, 0, 8, 1, 1, 10, 6, 1, 4, 0, 16, 6 0, 11, 0, 36, 16, 115, 111, 117, 114, 99, 101, 77, 7 97, 112, 112, 105, 110, 103, 85, 82, 76, 18, 46, 47, 8 114, 101, 108, 101, 97, 115, 101, 46, 119, 97, 115, 109, 9 46, 109, 97, 112 10 ]); 11 12 // The WebSocket server does not need to exist, because the bug occurs before 13 // any connection is attempted. 14 const imports = { 15 a: { 16 b: Reflect.construct.bind(null, WebSocket, ["ws://localhost:1234"]) 17 } 18 }; 19 20 promise_test( 21 () => WebAssembly.instantiate(module, imports), 22 "Ensure WebSockets can be constructed from WebAssembly" 23 );