← Back to Pull requests

Close iterators when conversion fails while creating a sequence from an iterator #1662

Open
unknown opened this pull request with 225 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 06, 2026 05:18 UTC
Author

Match ECMAScript behavior: when interrupted while consuming an iterator, such as from an exception not caused by the iterator itself, close that iterator. Also applied to async iterables, although this is not yet observable since the only consumer is Streams which converts to async_sequence<any> and so cannot fail.

  • At least two implementers are interested (and none opposed):

  • Safari (already implements this behavior)
    …
  • Tests are written and can be reviewed and commented upon at:

  • … <!-- If these tests are tentative, link a PR to make them non-tentative. -->
  • Implementation bugs are filed:

  • Chromium: …
    Gecko: …
    WebKit: N/A
    Deno: …
    Node.js: …
    webidl2.js: …
    widlparser: …
  • MDN issue is filed: …

  • The top of this comment includes a clear commit message to use.
  • <!--
    This comment and the below content is programmatically generated.
    You may add a comma-separated list of anchors you'd like a
    direct link to below (e.g. #idl-serializers, #idl-sequence):

    Don't remove this comment or modify anything below this line.
    If you don't want a preview generated for this pull request,
    just replace the whole of this comment's content by "no preview"
    and remove what's below.
    -->
    ***
    <a href="https://whatpr.org/webidl/1662.html" title="Last updated on Nov 6, 2026, 5:18 AM UTC (6678d1a)">Preview</a> | <a href="https://whatpr.org/webidl/1662/628f447...6678d1a.html" title="Last updated on Nov 6, 2026, 5:18 AM UTC (6678d1a)">Diff</a>

    Diff: 225 lines (+168 / -57) across 2 files Reviewer: bakkot Review duration: 39518m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.37) × (1 − Review Confidence (0.43)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 225 lines diff across 2 files
    0.37
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    42%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.324
    Real PR Conversation Timeline
    1 comments
    "Review active on #1662"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 43.0% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 36.9% (MEDIUM) · Higher = larger blast radius
    36.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 43.0% · Lower = rushed or shallow review
    43.0%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 21% · Safe to merge
    21%
    Repository