Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[exec Array] implement spread operator using iterator #811

Merged
merged 5 commits into from
Oct 11, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix the next_index comment
  • Loading branch information
croraf committed Oct 10, 2020
commit 8496a9a89ffd5c4a7bcb273fdd404f42b9ef0390
7 changes: 3 additions & 4 deletions boa/src/syntax/ast/node/array/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,9 @@ impl Executable for ArrayDecl {
let val = x.run(interpreter)?;
let iterator_record =
super::super::super::super::builtins::iterable::get_iterator(interpreter, val)?;
//not sure what to do with this next_index mentioned in the spec
//it is mentioned that it has to be returned from somewhere
//https://tc39.es/ecma262/#sec-runtime-semantics-arrayaccumulation
//let mut next_index = 0;
// TODO after proper internal Array representation as per https://github.com/boa-dev/boa/pull/811#discussion_r502460858
// next_index variable should be utilized here as per https://tc39.es/ecma262/#sec-runtime-semantics-arrayaccumulation
// let mut next_index = 0;
loop {
let next = iterator_record.next(interpreter)?;
if next.is_done() {
Expand Down