opencode/packages/codemode-rust
Sebastian Herrlinger 90a252f339 feat(codemode): iterate the program's iterators in native frames
for...of, destructuring, rest elements and spread over an iterator the VM
does not step itself (one whose [Symbol.iterator], next or return is the
program's, a helper's or the host's) now open, step and close it from a
native frame: the instruction pushes the frame, which makes the call and
hands the result back as the instruction would, a finished for...of
jumping to its exit. A step that fails forgets the iterator, as before.

native_resume with return or throw pushes a handler first, so what the
generator throws comes back to the frame instead of unwinding past it
while its step runs, and a for-of frame's close throws what closing threw.

Recorded: search parking in each, a generator whose finally throws while
closed, the iterator errors, and a suspension inside a custom next.
2026-11-18 18:56:12 +01:00
..
bench test(codemode): check libm-dependent pow and hypot cases on Linux only 2026-11-18 18:56:12 +01:00
conformance feat(codemode): iterate the program's iterators in native frames 2026-11-18 18:56:12 +01:00
crates/psychoscript feat(codemode): iterate the program's iterators in native frames 2026-11-18 18:56:12 +01:00
test262 feat(codemode): hold huge sparse arrays 2026-11-18 18:56:11 +01:00
.gitignore feat(codemode): add embeddable Rust port 2026-11-18 18:53:56 +01:00
AGENTS.md test(codemode): record tool calls with invalid input from the reference 2026-11-18 18:56:12 +01:00
Cargo.lock feat(codemode): collate localeCompare like the reference's host 2026-11-18 18:56:11 +01:00
Cargo.toml test(codemode): add a test262 parity runner for the Rust port 2026-11-18 18:53:57 +01:00
rust-toolchain.toml chore(codemode): pin the Rust toolchain and prepare compare.sh for CI 2026-11-18 18:53:57 +01:00