Skip to content

feat: support optional fromindex parameter in array includes()#275

Merged
cs01 merged 1 commit intomainfrom
feat/array-includes-fromindex
Mar 12, 2026
Merged

feat: support optional fromindex parameter in array includes()#275
cs01 merged 1 commit intomainfrom
feat/array-includes-fromindex

Conversation

@cs01
Copy link
Copy Markdown
Owner

@cs01 cs01 commented Mar 12, 2026

Summary

  • array.includes(value, fromIndex) now accepts optional fromIndex parameter per JS spec (was rejecting with error)
  • Negative fromIndex resolved as max(0, length + fromIndex) per JS spec
  • Works for both number[] and string[] arrays

Test plan

  • tests/fixtures/arrays/array-includes-fromindex.ts — positive/negative/past-end fromIndex for both number[] and string[]
  • npm run verify:quick passes (tests + Stage 1 self-hosting)

🤖 Generated with Claude Code

@cs01 cs01 merged commit 9f9dbf1 into main Mar 12, 2026
12 checks passed
@cs01 cs01 deleted the feat/array-includes-fromindex branch March 19, 2026 05:23
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.

1 participant