mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-25 19:21:11 +08:00
refactor: 移除语句计数辅助
This commit is contained in:
@@ -1280,14 +1280,8 @@ impl Compiler {
|
||||
|
||||
pub(crate) fn count_statement(&self, stmt: &Statement, ctx: &mut CompileCtx) {
|
||||
match stmt {
|
||||
Statement::ExpressionStatement(_)
|
||||
| Statement::ReturnStatement(_)
|
||||
| Statement::BreakStatement(_)
|
||||
| Statement::ContinueStatement(_)
|
||||
| Statement::LabeledStatement(_) => self.count_basic(stmt, ctx),
|
||||
Statement::BlockStatement(_) => self.count_block_domain(stmt, ctx),
|
||||
Statement::VariableDeclaration(_) | Statement::FunctionDeclaration(_) | Statement::ClassDeclaration(_) => {
|
||||
self.count_declaration_domain(stmt, ctx)
|
||||
Statement::BreakStatement(_) | Statement::ContinueStatement(_) | Statement::LabeledStatement(_) => {
|
||||
self.count_basic(stmt, ctx)
|
||||
}
|
||||
Statement::IfStatement(_) => self.count_control_domain(stmt, ctx),
|
||||
Statement::WhileStatement(_)
|
||||
@@ -1296,7 +1290,7 @@ impl Compiler {
|
||||
| Statement::ForInStatement(_)
|
||||
| Statement::ForOfStatement(_) => self.count_iteration_domain(stmt, ctx),
|
||||
Statement::SwitchStatement(_) => self.count_switch_domain(stmt, ctx),
|
||||
Statement::ThrowStatement(_) | Statement::TryStatement(_) => self.count_exception_domain(stmt, ctx),
|
||||
Statement::TryStatement(_) => self.count_exception_domain(stmt, ctx),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user