Files
rust_browser/tests/external/js262/fixtures/for-in-nested.js
Zachary D. Rowitsch 9733696b29
All checks were successful
ci / fast (linux) (push) Successful in 6m20s
Add JavaScript for...in / for...of loop support
Implement both loop types across the full stack: tokenizer (`In` keyword),
AST (`ForBinding`, `ForInStmt`, `ForOfStmt`), parser (refactored `parse_for()`
with `in`/contextual `of` detection), object model (`enumerable_keys()`), and
interpreter (per-iteration lexical scoping for let/const, `assign_to_target()`
for member/computed-member LHS patterns, var hoisting).

for...of supports arrays and strings natively; non-iterable types throw
TypeError. Full iterator protocol deferred to Symbol support.

Includes 24 parser tests, 45 interpreter tests, and 6 JS262 fixtures.
Promotes the existing for-in-loop known_fail to pass.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 10:03:44 -05:00

8 lines
136 B
JavaScript

var outer = {a: 1};
var inner = {x: 2};
for (var ok in outer) {
for (var ik in inner) {
console.log(ok + "." + ik);
}
}