Preserve flatMap TypeError when source iterator Close throws#628
Conversation
Use CloseIteratorPreservingError pattern in both DoAdvanceNext and DoDirectNext so a throwing .return() cannot swallow the non-iterable TypeError. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR fixes error-handling behavior in ChangesflatMap TypeError preservation on cleanup failure
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Suite TimingTest Runner (interpreted: 9,244 passed; bytecode: 9,244 passed)
MemoryGC rows aggregate the main thread plus all worker thread-local GCs. Test runner worker shutdown frees thread-local heaps in bulk; that shutdown reclamation is not counted as GC collections or collected objects.
Benchmarks (interpreted: 407; bytecode: 407)
MemoryGC rows aggregate the main thread plus all worker thread-local GCs. Benchmark runner performs explicit between-file collections, so collection and collected-object counts can be much higher than the test runner.
Measured on ubuntu-latest x64. |
Benchmark Results407 benchmarks Interpreted: 🟢 117 improved · 🔴 32 regressed · 258 unchanged · avg +1.9% arraybuffer.js — Interp: 🟢 2, 12 unch. · avg +2.4% · Bytecode: 🟢 11, 3 unch. · avg +7.7%
arrays.js — Interp: 🟢 2, 🔴 2, 15 unch. · avg -0.1% · Bytecode: 🟢 15, 4 unch. · avg +5.9%
async-await.js — Interp: 🟢 2, 4 unch. · avg +3.5% · Bytecode: 🟢 4, 2 unch. · avg +10.5%
async-generators.js — Interp: 2 unch. · avg +2.9% · Bytecode: 🟢 1, 1 unch. · avg +12.7%
base64.js — Interp: 🟢 2, 8 unch. · avg +1.6% · Bytecode: 🟢 3, 🔴 7 · avg -2.7%
classes.js — Interp: 🟢 14, 17 unch. · avg +2.8% · Bytecode: 🟢 16, 15 unch. · avg +7.0%
closures.js — Interp: 11 unch. · avg +1.9% · Bytecode: 🟢 10, 1 unch. · avg +8.6%
collections.js — Interp: 🟢 3, 9 unch. · avg +0.9% · Bytecode: 🟢 10, 2 unch. · avg +9.4%
csv.js — Interp: 🟢 2, 11 unch. · avg +0.9% · Bytecode: 🟢 13 · avg +7.4%
destructuring.js — Interp: 22 unch. · avg +0.7% · Bytecode: 🟢 19, 3 unch. · avg +6.7%
fibonacci.js — Interp: 8 unch. · avg +1.8% · Bytecode: 🟢 7, 1 unch. · avg +12.9%
float16array.js — Interp: 🟢 12, 🔴 1, 19 unch. · avg +2.3% · Bytecode: 🟢 23, 🔴 7, 2 unch. · avg +4.3%
for-of.js — Interp: 🟢 5, 2 unch. · avg +2.7% · Bytecode: 🟢 7 · avg +8.0%
generators.js — Interp: 🟢 1, 3 unch. · avg +1.1% · Bytecode: 🟢 3, 🔴 1 · avg +2.9%
iterators.js — Interp: 🟢 12, 🔴 4, 26 unch. · avg +1.4% · Bytecode: 🟢 23, 🔴 2, 17 unch. · avg +3.7%
json.js — Interp: 🟢 3, 🔴 3, 14 unch. · avg +0.5% · Bytecode: 🟢 19, 1 unch. · avg +7.6%
jsx.jsx — Interp: 🟢 8, 13 unch. · avg +1.9% · Bytecode: 🟢 20, 1 unch. · avg +7.3%
modules.js — Interp: 🔴 3, 6 unch. · avg -1.6% · Bytecode: 🟢 9 · avg +13.6%
numbers.js — Interp: 🟢 10, 1 unch. · avg +3.7% · Bytecode: 🟢 11 · avg +7.8%
objects.js — Interp: 7 unch. · avg -1.0% · Bytecode: 🟢 7 · avg +8.3%
promises.js — Interp: 🟢 5, 7 unch. · avg +2.8% · Bytecode: 🟢 4, 8 unch. · avg +5.4%
regexp.js — Interp: 11 unch. · avg -0.1% · Bytecode: 🟢 5, 🔴 6 · avg -1.4%
strings.js — Interp: 🟢 17, 2 unch. · avg +5.9% · Bytecode: 🟢 14, 5 unch. · avg +6.2%
tsv.js — Interp: 🟢 1, 8 unch. · avg +1.4% · Bytecode: 🟢 9 · avg +11.7%
typed-arrays.js — Interp: 🟢 5, 🔴 10, 7 unch. · avg +9.9% · Bytecode: 🟢 11, 🔴 6, 5 unch. · avg -5.6%
uint8array-encoding.js — Interp: 🟢 10, 8 unch. · avg +13.0% · Bytecode: 🟢 8, 🔴 3, 7 unch. · avg +3.7%
weak-collections.js — Interp: 🟢 1, 🔴 9, 5 unch. · avg -18.7% · Bytecode: 🟢 12, 3 unch. · avg +27.9%
Deterministic profile diffDeterministic profile diff: no significant changes. Measured on ubuntu-latest x64. Benchmark ranges compare cached main-branch min/max ops/sec with the PR run; overlapping ranges are treated as unchanged noise. Percentage deltas are secondary context. |
test262 Conformance
Areas closest to 100%
Per-test deltas (+1 / -0)Newly passing (1):
Steady-state failures are non-blocking; regressions vs the cached main baseline (lower total pass count, or any PASS → non-PASS transition) fail the conformance gate. Measured on ubuntu-latest x64, bytecode mode. Areas grouped by the first two test262 path components; minimum 25 attempted tests, areas already at 100% excluded. Δ vs main compares against the most recent cached |
Summary
TypeErrorthrown byIterator.prototype.flatMapwhen the mapper returns a non-iterable value, even when the source iterator's.return()also throws during cleanup.DoAdvanceNextandDoDirectNextinTGocciaLazyFlatMapIteratorValuenow use theCloseIteratorPreservingErrorpattern (already used elsewhere in the same class) instead of callingFSourceIterator.Closedirectly beforeThrowTypeError.Testing