JsModule { bom_token: missing (optional), interpreter_token: missing (optional), directives: JsDirectiveList [], items: JsModuleItemList [ JsFunctionDeclaration { async_token: missing (optional), function_token: FUNCTION_KW@0..8 "function" [] [], star_token: STAR@8..10 "*" [] [Whitespace(" ")], id: JsIdentifierBinding { name_token: IDENT@10..14 "test" [] [], }, type_parameters: missing (optional), parameters: JsParameters { l_paren_token: L_PAREN@14..15 "(" [] [], items: JsParameterList [ JsFormalParameter { decorators: JsDecoratorList [], binding: JsIdentifierBinding { name_token: IDENT@15..17 "a" [] [Whitespace(" ")], }, question_mark_token: missing (optional), type_annotation: missing (optional), initializer: JsInitializerClause { eq_token: EQ@17..19 "=" [] [Whitespace(" ")], expression: JsBogusExpression { items: [ YIELD_KW@19..25 "yield" [] [Whitespace(" ")], JsYieldArgument { star_token: missing (optional), expression: JsStringLiteralExpression { value_token: JS_STRING_LITERAL@25..31 "\"test\"" [] [], }, }, ], }, }, }, ], r_paren_token: R_PAREN@31..33 ")" [] [Whitespace(" ")], }, return_type_annotation: missing (optional), body: JsFunctionBody { l_curly_token: L_CURLY@33..34 "{" [] [], directives: JsDirectiveList [], statements: JsStatementList [], r_curly_token: R_CURLY@34..35 "}" [] [], }, }, JsFunctionDeclaration { async_token: missing (optional), function_token: FUNCTION_KW@35..45 "function" [Newline("\n")] [Whitespace(" ")], star_token: missing (optional), id: JsIdentifierBinding { name_token: IDENT@45..50 "test2" [] [], }, type_parameters: missing (optional), parameters: JsParameters { l_paren_token: L_PAREN@50..51 "(" [] [], items: JsParameterList [ JsFormalParameter { decorators: JsDecoratorList [], binding: JsIdentifierBinding { name_token: IDENT@51..53 "a" [] [Whitespace(" ")], }, question_mark_token: missing (optional), type_annotation: missing (optional), initializer: JsInitializerClause { eq_token: EQ@53..55 "=" [] [Whitespace(" ")], expression: JsBogusExpression { items: [ YIELD_KW@55..61 "yield" [] [Whitespace(" ")], JsYieldArgument { star_token: missing (optional), expression: JsStringLiteralExpression { value_token: JS_STRING_LITERAL@61..67 "\"test\"" [] [], }, }, ], }, }, }, ], r_paren_token: R_PAREN@67..69 ")" [] [Whitespace(" ")], }, return_type_annotation: missing (optional), body: JsFunctionBody { l_curly_token: L_CURLY@69..70 "{" [] [], directives: JsDirectiveList [], statements: JsStatementList [], r_curly_token: R_CURLY@70..71 "}" [] [], }, }, ], eof_token: EOF@71..72 "" [Newline("\n")] [], } 0: JS_MODULE@0..72 0: (empty) 1: (empty) 2: JS_DIRECTIVE_LIST@0..0 3: JS_MODULE_ITEM_LIST@0..71 0: JS_FUNCTION_DECLARATION@0..35 0: (empty) 1: FUNCTION_KW@0..8 "function" [] [] 2: STAR@8..10 "*" [] [Whitespace(" ")] 3: JS_IDENTIFIER_BINDING@10..14 0: IDENT@10..14 "test" [] [] 4: (empty) 5: JS_PARAMETERS@14..33 0: L_PAREN@14..15 "(" [] [] 1: JS_PARAMETER_LIST@15..31 0: JS_FORMAL_PARAMETER@15..31 0: JS_DECORATOR_LIST@15..15 1: JS_IDENTIFIER_BINDING@15..17 0: IDENT@15..17 "a" [] [Whitespace(" ")] 2: (empty) 3: (empty) 4: JS_INITIALIZER_CLAUSE@17..31 0: EQ@17..19 "=" [] [Whitespace(" ")] 1: JS_BOGUS_EXPRESSION@19..31 0: YIELD_KW@19..25 "yield" [] [Whitespace(" ")] 1: JS_YIELD_ARGUMENT@25..31 0: (empty) 1: JS_STRING_LITERAL_EXPRESSION@25..31 0: JS_STRING_LITERAL@25..31 "\"test\"" [] [] 2: R_PAREN@31..33 ")" [] [Whitespace(" ")] 6: (empty) 7: JS_FUNCTION_BODY@33..35 0: L_CURLY@33..34 "{" [] [] 1: JS_DIRECTIVE_LIST@34..34 2: JS_STATEMENT_LIST@34..34 3: R_CURLY@34..35 "}" [] [] 1: JS_FUNCTION_DECLARATION@35..71 0: (empty) 1: FUNCTION_KW@35..45 "function" [Newline("\n")] [Whitespace(" ")] 2: (empty) 3: JS_IDENTIFIER_BINDING@45..50 0: IDENT@45..50 "test2" [] [] 4: (empty) 5: JS_PARAMETERS@50..69 0: L_PAREN@50..51 "(" [] [] 1: JS_PARAMETER_LIST@51..67 0: JS_FORMAL_PARAMETER@51..67 0: JS_DECORATOR_LIST@51..51 1: JS_IDENTIFIER_BINDING@51..53 0: IDENT@51..53 "a" [] [Whitespace(" ")] 2: (empty) 3: (empty) 4: JS_INITIALIZER_CLAUSE@53..67 0: EQ@53..55 "=" [] [Whitespace(" ")] 1: JS_BOGUS_EXPRESSION@55..67 0: YIELD_KW@55..61 "yield" [] [Whitespace(" ")] 1: JS_YIELD_ARGUMENT@61..67 0: (empty) 1: JS_STRING_LITERAL_EXPRESSION@61..67 0: JS_STRING_LITERAL@61..67 "\"test\"" [] [] 2: R_PAREN@67..69 ")" [] [Whitespace(" ")] 6: (empty) 7: JS_FUNCTION_BODY@69..71 0: L_CURLY@69..70 "{" [] [] 1: JS_DIRECTIVE_LIST@70..70 2: JS_STATEMENT_LIST@70..70 3: R_CURLY@70..71 "}" [] [] 4: EOF@71..72 "" [Newline("\n")] [] -- yield_expr_in_parameter_initializer.js:1:20 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × `yield` is only allowed within generator functions. > 1 │ function* test(a = yield "test") {} │ ^^^^^ 2 │ function test2(a = yield "test") {} 3 │ -- yield_expr_in_parameter_initializer.js:2:20 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × `yield` is only allowed within generator functions. 1 │ function* test(a = yield "test") {} > 2 │ function test2(a = yield "test") {} │ ^^^^^ 3 │ -- function* test(a = yield "test") {} function test2(a = yield "test") {}