Skip to content

Commit

Permalink
refactor(semantic): expose 1 checker function instead of 2 (#3694)
Browse files Browse the repository at this point in the history
  • Loading branch information
Boshen committed Jun 15, 2024
1 parent de0690f commit a94a72d
Show file tree
Hide file tree
Showing 4 changed files with 158 additions and 154 deletions.
7 changes: 3 additions & 4 deletions crates/oxc_semantic/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use oxc_syntax::{

use crate::{
binder::Binder,
checker::{EarlyErrorJavaScript, EarlyErrorTypeScript},
checker,
class::ClassTableBuilder,
control_flow::{
ControlFlowGraphBuilder, CtxCursor, CtxFlags, EdgeType, ErrorEdgeKind,
Expand Down Expand Up @@ -151,7 +151,7 @@ impl<'a> SemanticBuilder<'a> {

// Checking syntax error on module record requires scope information from the previous AST pass
if self.check_syntax_error {
EarlyErrorJavaScript::check_module_record(&self);
checker::check_module_record(&self);
}
}

Expand Down Expand Up @@ -449,8 +449,7 @@ impl<'a> Visit<'a> for SemanticBuilder<'a> {
fn leave_node(&mut self, kind: AstKind<'a>) {
if self.check_syntax_error {
let node = self.nodes.get_node(self.current_node_id);
EarlyErrorJavaScript::run(node, self);
EarlyErrorTypeScript::run(node, self);
checker::check(node, self);
}
self.leave_kind(kind);
self.pop_ast_node();
Expand Down
Loading

0 comments on commit a94a72d

Please sign in to comment.