mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-25 19:21:11 +08:00
feat: rest 参数(function f(...args)),实参区收集数组
This commit is contained in:
@@ -19,6 +19,12 @@ impl Emitter {
|
||||
names.insert(bi.name.to_string());
|
||||
}
|
||||
}
|
||||
// rest 形参也是本函数作用域绑定,遮蔽外层同名变量。
|
||||
if let Some(rest) = ¶ms.rest {
|
||||
if let oxide_parser::BindingPattern::BindingIdentifier(bi) = &rest.rest.argument {
|
||||
names.insert(bi.name.to_string());
|
||||
}
|
||||
}
|
||||
names
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user