File: bug1793935.any.js

package info (click to toggle)
thunderbird 1%3A143.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 4,703,968 kB
  • sloc: cpp: 7,770,492; javascript: 5,943,842; ansic: 3,918,754; python: 1,418,263; xml: 653,354; asm: 474,045; java: 183,079; sh: 111,238; makefile: 20,410; perl: 14,359; objc: 13,059; yacc: 4,583; pascal: 3,405; lex: 1,720; ruby: 999; exp: 762; sql: 715; awk: 580; php: 436; lisp: 430; sed: 69; csh: 10
file content (23 lines) | stat: -rw-r--r-- 852 bytes parent folder | download | duplicates (23)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// The module has an import that's immediately called by the start function.
const module = new Uint8Array([
    0,  97, 115, 109,   1,   0,   0,   0,   1,  4,   1,  96,
    0,   0,   2,   7,   1,   1,  97,   1,  98,  0,   0,   3,
    2,   1,   0,   8,   1,   1,  10,   6,   1,  4,   0,  16,
    0,  11,   0,  36,  16, 115, 111, 117, 114, 99, 101,  77,
   97, 112, 112, 105, 110, 103,  85,  82,  76, 18,  46,  47,
  114, 101, 108, 101,  97, 115, 101,  46, 119, 97, 115, 109,
   46, 109,  97, 112
]);

// The WebSocket server does not need to exist, because the bug occurs before
// any connection is attempted.
const imports = {
    a: {
        b: Reflect.construct.bind(null, WebSocket, ["ws://localhost:1234"])
    }
};

promise_test(
    () => WebAssembly.instantiate(module, imports),
    "Ensure WebSockets can be constructed from WebAssembly"
);