Skip to content

Fix lazy seq of unknown size, reversed indexed iteration - #2268

Merged
jdeniau merged 1 commit into
mainfrom
fix-2267
Aug 16, 2026
Merged

jdeniau merged 1 commit into
mainfrom
fix-2267

Conversation

@jdeniau

@jdeniau jdeniau commented Aug 16, 2026

Copy link
Copy Markdown
Member

For a lazy seq of unknown size, reversed indexed iteration used to produce NaN keys.

Use ensureSize return value with the the reversed sequence (the existing ensureSize(collection) guard fixes the wrong object's size).

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes reversed indexed iteration for lazy sequences with unknown sizes.

Changes:

  • Uses the materialized collection size when generating reverse indices.
  • Adds regression coverage for iteration APIs.
  • Modifies native SWC lockfile platform metadata.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/Operations.js Corrects reverse-index calculation.
__tests__/IndexedSeq.ts Tests lazy reversed sequence behavior.
package-lock.json Removes SWC libc constraints.
Suppressed comments (1)

src/Operations.js:318

  • This comment is inaccurate: the forward branch does use i++ as the emitted index; only the materialized size is unnecessary. Reword it to describe why size calculation is skipped.
    // ignore when not reversed, since the index is not used in that case.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/Operations.js Resolved
@jdeniau
jdeniau merged commit 364020f into main Aug 16, 2026
9 checks passed
@jdeniau
jdeniau deleted the fix-2267 branch August 16, 2026 22:01
@jdeniau jdeniau linked an issue Aug 16, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reverse lazy sequence keys are NaN

2 participants