refactor: 函数 strict 标志入 IR/编译/缓存链(零行为地基)

This commit is contained in:
2026-08-16 16:46:33 +08:00
parent a00ef2a7c6
commit 3e071d3337
10 changed files with 89 additions and 20 deletions
+6
View File
@@ -56,6 +56,12 @@ fn hash_program(program: &oxide_parser::Program, include_binding_names: bool) ->
statement::hash_statement(stmt, &mut h, include_binding_names);
}
// directives 决定脚本/函数严格模式:不纳入 hash 时 `"use strict"; f()`
// 与 `f()` 缓存键相同,复用错误字节码(严格标志随缓存命中错配)。
for directive in &program.directives {
directive.directive.as_str().hash(&mut h);
}
h.finish()
}