style: concat 实参循环改迭代器写法

This commit is contained in:
2026-10-16 12:25:30 +00:00
parent 97779b901a
commit 2dd47bef2a
+2 -2
View File
@@ -1794,8 +1794,8 @@ fn helper_step_zip<H: VmHost>(
/// - 方法为 undefined/null/其它不可调用值 → TypeError(构造期不触发方法调用)。 /// - 方法为 undefined/null/其它不可调用值 → TypeError(构造期不触发方法调用)。
pub fn iterator_concat<H: VmHost>(vm: &mut H, args: &[u8]) -> NativeResult { pub fn iterator_concat<H: VmHost>(vm: &mut H, args: &[u8]) -> NativeResult {
let mut items: Vec<(JsValue, JsValue)> = Vec::new(); let mut items: Vec<(JsValue, JsValue)> = Vec::new();
for i in 1..args.len() { for &reg in args.iter().skip(1) {
let item = vm.reg(args[i]); let item = vm.reg(reg);
if !item.is_object() { if !item.is_object() {
return NativeResult::Err(crate::error::create_type_error(vm, "Iterator.concat argument is not an object")); return NativeResult::Err(crate::error::create_type_error(vm, "Iterator.concat argument is not an object"));
} }