mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-27 12:11:12 +08:00
refactor: emit 冗余标志参数收敛为内部推导
This commit is contained in:
@@ -48,7 +48,7 @@ impl Emitter {
|
||||
None => {
|
||||
let reg = ctx.alloc_reg();
|
||||
ctx.push_scope_with_kind(ScopeKind::BlockScope);
|
||||
ctx.declare(name, reg, VariableDeclarationKind::Const, true)?;
|
||||
ctx.declare(name, reg, VariableDeclarationKind::Const)?;
|
||||
pushed_scope = true;
|
||||
reg
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ impl Emitter {
|
||||
let key_reg = if prop.computed {
|
||||
self.emit_class_array_key_reg(key_slot.unwrap_or(0), ctx)?
|
||||
} else {
|
||||
self.emit_class_key_reg(&prop.key, false, ctx)?
|
||||
self.emit_class_key_reg(&prop.key, ctx)?
|
||||
};
|
||||
let value_reg = self.emit_field_value(prop.value.as_ref(), ctx)?;
|
||||
ctx.inst(Inst::define_prop(
|
||||
|
||||
@@ -39,7 +39,7 @@ impl Emitter {
|
||||
let key_reg = if method.computed {
|
||||
self.emit_class_array_key_reg(key_slot.unwrap_or(0), ctx)?
|
||||
} else {
|
||||
self.emit_class_key_reg(&method.key, false, ctx)?
|
||||
self.emit_class_key_reg(&method.key, ctx)?
|
||||
};
|
||||
let method_name = if method.computed {
|
||||
"<computed>".to_string()
|
||||
|
||||
Reference in New Issue
Block a user