fix: 函数 async/generator 标志纳入编译缓存键防字节码错配

This commit is contained in:
2026-08-16 17:34:03 +08:00
parent c8b1ccd0a0
commit ae6c60d99d
4 changed files with 53 additions and 0 deletions
@@ -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 {