goal-async-function-params-or-body.js (761B)
1 // Copyright (C) 2018 André Bargull. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 esid: sec-left-hand-side-expressions-static-semantics-early-errors 6 description: > 7 An Syntax Error is thrown when the syntactic goal symbol is AsyncFunctionBody or FormalParameters. 8 info: | 9 It is an early Syntax Error if Module is not the syntactic goal symbol. 10 features: [import.meta, async-functions] 11 ---*/ 12 13 var AsyncFunction = async function(){}.constructor; 14 15 assert.throws(SyntaxError, function() { 16 AsyncFunction("import.meta"); 17 }, "import.meta in AsyncFunctionBody"); 18 19 assert.throws(SyntaxError, function() { 20 AsyncFunction("a = import.meta", ""); 21 }, "import.meta in FormalParameters"); 22 23 reportCompare(0, 0);