Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions crates/oxc_semantic/src/checker/javascript.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,13 @@ pub fn check_binding_identifier(ident: &BindingIdentifier, ctx: &SemanticBuilder
if ident.name == "let" {
for node_kind in ctx.nodes.ancestor_kinds(ctx.current_node_id) {
match node_kind {
AstKind::VariableDeclaration(decl) if decl.kind.is_lexical() => {
return ctx.error(invalid_let_declaration(decl.kind.as_str(), ident.span));
}
AstKind::VariableDeclaration(_)
| AstKind::Function(_)
| AstKind::Program(_) => {
AstKind::VariableDeclarator(decl) => {
if decl.kind.is_lexical() {
ctx.error(invalid_let_declaration(decl.kind.as_str(), ident.span));
}
break;
}
AstKind::Function(_) => break,
_ => {}
}
}
Expand Down
Loading