mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-24 02:31:13 +08:00
fix: 函数 async/generator 标志纳入编译缓存键防字节码错配
This commit is contained in:
@@ -8,6 +8,8 @@ pub(super) fn hash_class_element(element: &ClassElement, h: &mut rustc_hash::FxH
|
||||
method.r#static.hash(h);
|
||||
method.computed.hash(h);
|
||||
std::mem::discriminant(&method.kind).hash(h);
|
||||
method.value.r#async.hash(h);
|
||||
method.value.generator.hash(h);
|
||||
property::hash_property_key(&method.key, h, include_binding_names);
|
||||
if method.computed {
|
||||
property::hash_property_key(&method.key, h, include_binding_names);
|
||||
|
||||
@@ -82,6 +82,7 @@ pub(super) fn hash_expression(expr: &Expression, h: &mut rustc_hash::FxHasher, i
|
||||
}
|
||||
}
|
||||
Expression::ArrowFunctionExpression(arrow) => {
|
||||
arrow.r#async.hash(h);
|
||||
(arrow.params.items.len() as u32).hash(h);
|
||||
if include_binding_names {
|
||||
for param in &arrow.params.items {
|
||||
@@ -91,6 +92,8 @@ pub(super) fn hash_expression(expr: &Expression, h: &mut rustc_hash::FxHasher, i
|
||||
hash_function_body(&arrow.body, h, include_binding_names);
|
||||
}
|
||||
Expression::FunctionExpression(fe) => {
|
||||
fe.r#async.hash(h);
|
||||
fe.generator.hash(h);
|
||||
(fe.params.items.len() as u32).hash(h);
|
||||
if include_binding_names {
|
||||
if let Some(id) = &fe.id {
|
||||
|
||||
@@ -194,6 +194,8 @@ fn hash_for_statement(fr: &oxide_parser::ForStatement<'_>, h: &mut rustc_hash::F
|
||||
}
|
||||
|
||||
fn hash_function_declaration(fd: &Function<'_>, h: &mut rustc_hash::FxHasher, include_binding_names: bool) {
|
||||
fd.r#async.hash(h);
|
||||
fd.generator.hash(h);
|
||||
if include_binding_names {
|
||||
if let Some(id) = &fd.id {
|
||||
id.name.as_str().hash(h);
|
||||
|
||||
Reference in New Issue
Block a user