we (web engine): Experimental web browser project to understand the limits of Claude
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Review fixes: remove dead code and confused comments in Yield handler

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+3 -27
+3 -27
crates/js/src/vm.rs
··· 2476 2476 // Create {value, done: false} result. 2477 2477 let result = self.make_iterator_result(yield_val, false); 2478 2478 2479 - // If this was the only frame, return the result. 2480 - if self.frames.is_empty() { 2481 - return Ok(result); 2482 - } 2483 - 2484 - // Otherwise, write the result into the generator_next caller's dst. 2485 - let caller_fi = self.frames.len() - 1; 2486 - let return_reg = self.frames[caller_fi].base; 2487 - // The return_reg is stored on the popped frame — but we stored 2488 - // the gen_ref there. We need to use the gen_next's return location. 2489 - // Actually, the generator frame's return_reg IS where the result goes. 2490 - let old_return_reg = self.registers.len().min(saved_base + reg_count); // just use gen_ref loc 2491 - let _ = old_return_reg; 2492 - let _ = return_reg; 2493 - // The result should go to the return register that was set when 2494 - // we pushed the frame. Since we already popped, we stored it at 2495 - // frame.return_reg. Let's look at where that was. 2496 - // Actually: the generator resumes via run_generator which pushed 2497 - // a frame with return_reg set. When Yield pops that frame, it needs 2498 - // to write the result to that return_reg. But the frame is already popped. 2499 - // Let's re-read it before popping. 2500 - // (This path handles generators called from the run loop.) 2501 - 2502 - // Actually, generators always run via run_generator which uses 2503 - // an isolated frame stack. After Yield pops, the frame stack is empty 2504 - // and we fall out of run() with the returned result. 2505 - // So this unreachable path should not happen. 2479 + // Generators always run via run_generator which uses an isolated 2480 + // frame stack. After Yield pops the generator frame, the stack is 2481 + // empty and we return the {value, done} result to run_generator. 2506 2482 return Ok(result); 2507 2483 } 2508 2484