mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-26 03:31:12 +08:00
feat: 私有名方法名加井号前缀加嵌套类独立作用域
This commit is contained in:
@@ -75,7 +75,10 @@ impl Emitter {
|
||||
return Err("expected private method key".into());
|
||||
};
|
||||
let name = private.name.as_str();
|
||||
let method_reg = self.emit_class_method_function(method, name, home_reg, ctx, self_binding, class_self_cell)?;
|
||||
// 私有方法/访问器的函数名带 `#` 前缀(SetFunctionName 语义:私有键的
|
||||
// 字符串值即 `#name`,访问器另加 `get `/`set ` 前缀)。
|
||||
let method_reg =
|
||||
self.emit_class_method_function(method, &format!("#{name}"), home_reg, ctx, self_binding, class_self_cell)?;
|
||||
match method.kind {
|
||||
MethodDefinitionKind::Method => {
|
||||
let key_reg = self.emit_private_id_reg(name, ctx)?;
|
||||
|
||||
Reference in New Issue
Block a user