JsScript { bom_token: missing (optional), interpreter_token: missing (optional), directives: JsDirectiveList [], statements: JsStatementList [ JsExpressionStatement { expression: JsBogusExpression { items: [ YIELD_KW@0..16 "yield" [Comments("// SCRIPT"), Newline("\n")] [Whitespace(" ")], JsYieldArgument { star_token: missing (optional), expression: JsNumberLiteralExpression { value_token: JS_NUMBER_LITERAL@16..18 "10" [] [], }, }, ], }, semicolon_token: SEMICOLON@18..19 ";" [] [], }, ], eof_token: EOF@19..20 "" [Newline("\n")] [], } 0: JS_SCRIPT@0..20 0: (empty) 1: (empty) 2: JS_DIRECTIVE_LIST@0..0 3: JS_STATEMENT_LIST@0..19 0: JS_EXPRESSION_STATEMENT@0..19 0: JS_BOGUS_EXPRESSION@0..18 0: YIELD_KW@0..16 "yield" [Comments("// SCRIPT"), Newline("\n")] [Whitespace(" ")] 1: JS_YIELD_ARGUMENT@16..18 0: (empty) 1: JS_NUMBER_LITERAL_EXPRESSION@16..18 0: JS_NUMBER_LITERAL@16..18 "10" [] [] 1: SEMICOLON@18..19 ";" [] [] 4: EOF@19..20 "" [Newline("\n")] [] -- yield_at_top_level_script.js:2:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × `yield` is only allowed within generator functions. 1 │ // SCRIPT > 2 │ yield 10; │ ^^^^^ 3 │ -- // SCRIPT yield 10;