JsModule { bom_token: missing (optional), interpreter_token: missing (optional), directives: JsDirectiveList [], items: JsModuleItemList [ JsFunctionDeclaration { async_token: missing (optional), function_token: FUNCTION_KW@0..9 "function" [] [Whitespace(" ")], star_token: missing (optional), id: JsIdentifierBinding { name_token: IDENT@9..13 "test" [] [], }, type_parameters: missing (optional), parameters: JsParameters { l_paren_token: L_PAREN@13..14 "(" [] [], items: JsParameterList [], r_paren_token: R_PAREN@14..16 ")" [] [Whitespace(" ")], }, return_type_annotation: missing (optional), body: JsFunctionBody { l_curly_token: L_CURLY@16..18 "{" [] [Whitespace(" ")], directives: JsDirectiveList [], statements: JsStatementList [ JsExpressionStatement { expression: JsBogusExpression { items: [ AWAIT_KW@18..24 "await" [] [Whitespace(" ")], JsNumberLiteralExpression { value_token: JS_NUMBER_LITERAL@24..26 "10" [] [], }, ], }, semicolon_token: SEMICOLON@26..28 ";" [] [Whitespace(" ")], }, ], r_curly_token: R_CURLY@28..29 "}" [] [], }, }, ], eof_token: EOF@29..30 "" [Newline("\n")] [], } 0: JS_MODULE@0..30 0: (empty) 1: (empty) 2: JS_DIRECTIVE_LIST@0..0 3: JS_MODULE_ITEM_LIST@0..29 0: JS_FUNCTION_DECLARATION@0..29 0: (empty) 1: FUNCTION_KW@0..9 "function" [] [Whitespace(" ")] 2: (empty) 3: JS_IDENTIFIER_BINDING@9..13 0: IDENT@9..13 "test" [] [] 4: (empty) 5: JS_PARAMETERS@13..16 0: L_PAREN@13..14 "(" [] [] 1: JS_PARAMETER_LIST@14..14 2: R_PAREN@14..16 ")" [] [Whitespace(" ")] 6: (empty) 7: JS_FUNCTION_BODY@16..29 0: L_CURLY@16..18 "{" [] [Whitespace(" ")] 1: JS_DIRECTIVE_LIST@18..18 2: JS_STATEMENT_LIST@18..28 0: JS_EXPRESSION_STATEMENT@18..28 0: JS_BOGUS_EXPRESSION@18..26 0: AWAIT_KW@18..24 "await" [] [Whitespace(" ")] 1: JS_NUMBER_LITERAL_EXPRESSION@24..26 0: JS_NUMBER_LITERAL@24..26 "10" [] [] 1: SEMICOLON@26..28 ";" [] [Whitespace(" ")] 3: R_CURLY@28..29 "}" [] [] 4: EOF@29..30 "" [Newline("\n")] [] -- await_in_non_async_function.js:1:19 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × `await` is only allowed within async functions and at the top levels of modules. > 1 │ function test() { await 10; } │ ^^^^^ 2 │ -- function test() { await 10; }