JsModule { bom_token: missing (optional), interpreter_token: missing (optional), directives: JsDirectiveList [], items: JsModuleItemList [ JsIfStatement { if_token: IF_KW@0..3 "if" [] [Whitespace(" ")], l_paren_token: L_PAREN@3..4 "(" [] [], test: JsBooleanLiteralExpression { value_token: TRUE_KW@4..8 "true" [] [], }, r_paren_token: R_PAREN@8..10 ")" [] [Whitespace(" ")], consequent: JsBogusStatement { items: [ JsVariableDeclaration { await_token: missing (optional), kind: LET_KW@10..14 "let" [] [Whitespace(" ")], declarators: JsVariableDeclaratorList [ JsVariableDeclarator { id: JsIdentifierBinding { name_token: IDENT@14..15 "a" [] [], }, variable_annotation: missing (optional), initializer: missing (optional), }, ], }, SEMICOLON@15..16 ";" [] [], ], }, else_clause: missing (optional), }, JsWhileStatement { while_token: WHILE_KW@16..23 "while" [Newline("\n")] [Whitespace(" ")], l_paren_token: L_PAREN@23..24 "(" [] [], test: JsBooleanLiteralExpression { value_token: TRUE_KW@24..28 "true" [] [], }, r_paren_token: R_PAREN@28..30 ")" [] [Whitespace(" ")], body: JsBogusStatement { items: [ JsVariableDeclaration { await_token: missing (optional), kind: CONST_KW@30..36 "const" [] [Whitespace(" ")], declarators: JsVariableDeclaratorList [ JsVariableDeclarator { id: JsIdentifierBinding { name_token: IDENT@36..38 "b" [] [Whitespace(" ")], }, variable_annotation: missing (optional), initializer: JsInitializerClause { eq_token: EQ@38..40 "=" [] [Whitespace(" ")], expression: JsNumberLiteralExpression { value_token: JS_NUMBER_LITERAL@40..41 "5" [] [], }, }, }, ], }, SEMICOLON@41..42 ";" [] [], ], }, }, ], eof_token: EOF@42..43 "" [Newline("\n")] [], } 0: JS_MODULE@0..43 0: (empty) 1: (empty) 2: JS_DIRECTIVE_LIST@0..0 3: JS_MODULE_ITEM_LIST@0..42 0: JS_IF_STATEMENT@0..16 0: IF_KW@0..3 "if" [] [Whitespace(" ")] 1: L_PAREN@3..4 "(" [] [] 2: JS_BOOLEAN_LITERAL_EXPRESSION@4..8 0: TRUE_KW@4..8 "true" [] [] 3: R_PAREN@8..10 ")" [] [Whitespace(" ")] 4: JS_BOGUS_STATEMENT@10..16 0: JS_VARIABLE_DECLARATION@10..15 0: (empty) 1: LET_KW@10..14 "let" [] [Whitespace(" ")] 2: JS_VARIABLE_DECLARATOR_LIST@14..15 0: JS_VARIABLE_DECLARATOR@14..15 0: JS_IDENTIFIER_BINDING@14..15 0: IDENT@14..15 "a" [] [] 1: (empty) 2: (empty) 1: SEMICOLON@15..16 ";" [] [] 5: (empty) 1: JS_WHILE_STATEMENT@16..42 0: WHILE_KW@16..23 "while" [Newline("\n")] [Whitespace(" ")] 1: L_PAREN@23..24 "(" [] [] 2: JS_BOOLEAN_LITERAL_EXPRESSION@24..28 0: TRUE_KW@24..28 "true" [] [] 3: R_PAREN@28..30 ")" [] [Whitespace(" ")] 4: JS_BOGUS_STATEMENT@30..42 0: JS_VARIABLE_DECLARATION@30..41 0: (empty) 1: CONST_KW@30..36 "const" [] [Whitespace(" ")] 2: JS_VARIABLE_DECLARATOR_LIST@36..41 0: JS_VARIABLE_DECLARATOR@36..41 0: JS_IDENTIFIER_BINDING@36..38 0: IDENT@36..38 "b" [] [Whitespace(" ")] 1: (empty) 2: JS_INITIALIZER_CLAUSE@38..41 0: EQ@38..40 "=" [] [Whitespace(" ")] 1: JS_NUMBER_LITERAL_EXPRESSION@40..41 0: JS_NUMBER_LITERAL@40..41 "5" [] [] 1: SEMICOLON@41..42 ";" [] [] 4: EOF@42..43 "" [Newline("\n")] [] -- lexical_declaration_in_single_statement_context.js:1:11 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Lexical declaration cannot appear in a single-statement context > 1 │ if (true) let a; │ ^^^^^^ 2 │ while (true) const b = 5; 3 │ i Wrap this declaration in a block statement -- lexical_declaration_in_single_statement_context.js:2:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Lexical declaration cannot appear in a single-statement context 1 │ if (true) let a; > 2 │ while (true) const b = 5; │ ^^^^^^^^^^^^ 3 │ i Wrap this declaration in a block statement -- if (true) let a; while (true) const b = 5;