Skip to content

Commit fa15f99

Browse files
committed
Implement rest operator in for of loop
1 parent 662b0b3 commit fa15f99

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

nova_vm/src/engine/bytecode/bytecode_compiler/assignment.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,8 +371,10 @@ impl<'s> CompileEvaluation<'s> for ast::ObjectAssignmentTarget<'s> {
371371
ctx.add_instruction(Instruction::Store);
372372
}
373373
}
374-
if let Some(_rest) = &self.rest {
375-
todo!()
374+
if let Some(rest) = &self.rest {
375+
rest.target.compile(ctx);
376+
ctx.add_instruction(Instruction::StoreCopy);
377+
ctx.add_instruction(Instruction::CopyDataProperties);
376378
}
377379
}
378380
}

0 commit comments

Comments
 (0)