summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/modules/bug-1501154.js
blob: 48a506db2bb40d96fa3c1310fb258f5ec959fcc1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Test using an empty string as a module specifier fails.
let result = null;
let error = null;
let promise = import("");
promise.then((ns) => {
    result = ns;
}).catch((e) => {
    error = e;
});

drainJobQueue();
assertEq(result, null);
assertEq(error instanceof Error, true);

// Test reading a directory as a file fails.
result = null;
error = null;
try {
    result = os.file.readFile(".");
} catch (e) {
    error = e;
}

assertEq(result, null);
assertEq(error instanceof Error, true);