feat: 支持 class extends 与 super 调用

This commit is contained in:
2026-06-09 09:51:34 +08:00
parent 5333be4622
commit a8fc9c061f
12 changed files with 478 additions and 32 deletions
+9
View File
@@ -123,6 +123,9 @@ fn hash_statement(stmt: &Statement, h: &mut rustc_hash::FxHasher) {
id.name.as_str().hash(h);
}
class.super_class.is_some().hash(h);
if let Some(super_class) = &class.super_class {
hash_expression(super_class, h);
}
for element in &class.body.body {
hash_class_element(element, h);
}
@@ -319,6 +322,9 @@ fn hash_expression(expr: &Expression, h: &mut rustc_hash::FxHasher) {
id.name.as_str().hash(h);
}
class.super_class.is_some().hash(h);
if let Some(super_class) = &class.super_class {
hash_expression(super_class, h);
}
for element in &class.body.body {
hash_class_element(element, h);
}
@@ -333,6 +339,9 @@ fn hash_expression(expr: &Expression, h: &mut rustc_hash::FxHasher) {
}
}
}
Expression::Super(_) => {
19u8.hash(h);
}
Expression::RegExpLiteral(lit) => {
if let Some(raw) = &lit.raw {
raw.to_string().hash(h);