parse-err-invoke-anon-gen-decl.js (854B)
1 // |reftest| error:SyntaxError module 2 // Copyright (C) 2016 the V8 project authors. All rights reserved. 3 // This code is governed by the BSD license found in the LICENSE file. 4 /*--- 5 description: > 6 Anonymous generator function declaration must not be interpreted as an 7 expression 8 esid: sec-exports 9 info: | 10 ExportDeclaration: 11 export * FromClause; 12 export * as IdentifierName FromClause; 13 export NamedExports FromClause; 14 export NamedExports; 15 export VariableStatement 16 export Declaration 17 export default HoistableDeclaration[Default] 18 export default ClassDeclaration[Default] 19 export default [lookahead ∉ { function, class }] AssignmentExpression[In]; 20 negative: 21 phase: parse 22 type: SyntaxError 23 flags: [module] 24 features: [generators] 25 ---*/ 26 27 $DONOTEVALUATE(); 28 29 export default function* () {}();