summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/async-functions/no-expression-closure.js
blob: 44d139fe41572c716a406b370c562f6dcedc21bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
function assertSyntaxError(code) {
    assertThrowsInstanceOf(function () { Function(code); }, SyntaxError, "Function:" + code);
    assertThrowsInstanceOf(function () { eval(code); }, SyntaxError, "eval:" + code);
    var ieval = eval;
    assertThrowsInstanceOf(function () { ieval(code); }, SyntaxError, "indirect eval:" + code);
}

// AsyncFunction statement
assertSyntaxError(`async function f() 0`);

// AsyncFunction expression
assertSyntaxError(`void async function() 0`);
assertSyntaxError(`void async function f() 0`);


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