Debian Codegraph @

js/src/jit-test/tests/modules/bug-1501154.js

raw
1 // Test using an empty string as a module specifier fails.
2 let result = null;
3 let error = null;
4 let promise = import("");
5 promise.then((ns) => {
6 result = ns;
7 }).catch((e) => {
8 error = e;
9 });
10
11 drainJobQueue();
12 assertEq(result, null);
13 assertEq(error instanceof Error, true);
14
15 // Test reading a directory as a file fails.
16 result = null;
17 error = null;
18 try {
19 result = os.file.readFile(".");
20 } catch (e) {
21 error = e;
22 }
23
24 assertEq(result, null);
25 assertEq(error instanceof Error, true);