mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-25 19:21:11 +08:00
feat: 支持 class extends 与 super 调用
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user