summaryrefslogtreecommitdiffstats
path: root/js/src/tests/ecma_2017/AsyncFunctions/await-error.js
blob: 1f40ea8a0b7aac29ef49914ee24f4c61046492da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
var BUGNUMBER = 1317153;
var summary = "await outside of async function should provide better error";

print(BUGNUMBER + ": " + summary);

let caught = false;
try {
    eval("await 10");
} catch(e) {
    assertEq(e.message, "await is only valid in async functions");
    caught = true;
}
assertEq(caught, true);

if (typeof reportCompare === "function")
    reportCompare(true, true);