style: 自动格式化

This commit is contained in:
2026-10-16 15:03:55 +00:00
parent cf0b59d892
commit d6e06788a9
2 changed files with 7 additions and 5 deletions
+6 -1
View File
@@ -81,7 +81,12 @@ impl Emitter {
{
// 全局词法环境读:先查镜像(顶层 let/const 真源),未命中回退全局对象属性。
let key_idx = ctx.add_constant(Constant::String(name.to_string()));
ctx.inst(Inst::new(OpCode::LOAD_GLOBAL_LEX, Operand::Reg(r), Operand::Const(key_idx), Operand::None));
ctx.inst(Inst::new(
OpCode::LOAD_GLOBAL_LEX,
Operand::Reg(r),
Operand::Const(key_idx),
Operand::None,
));
} else {
ctx.inst(Inst::new(OpCode::LOAD_VAR, Operand::Reg(r), Operand::Reg(var_reg), Operand::None));
}
+1 -4
View File
@@ -399,10 +399,7 @@ impl Emitter {
// 落全局词法环境,预声明期先写 undefined 占位(无初始化器声明即终值;
// 带初始化器声明由声明点写真实值覆盖)。eval 脚本顶层词法落自身声明
// 环境,不写镜像;块级词法(scope >0)不属全局词法环境,不写镜像。
if ctx.is_global_scope
&& !ctx.is_eval_script
&& ctx.is_global_lexical_binding(bi.name.as_str())
{
if ctx.is_global_scope && !ctx.is_eval_script && ctx.is_global_lexical_binding(bi.name.as_str()) {
let key_idx = ctx.add_constant(Constant::String(bi.name.to_string()));
let undef_reg = self.emit_undefined(ctx);
ctx.inst(Inst::store_global_lex(Operand::Reg(undef_reg), key_idx));