Skip to content

feat: implement string.at() method with negative index support#255

Merged
cs01 merged 1 commit intomainfrom
fix/string-at
Mar 12, 2026
Merged

feat: implement string.at() method with negative index support#255
cs01 merged 1 commit intomainfrom
fix/string-at

Conversation

@cs01
Copy link
Copy Markdown
Owner

@cs01 cs01 commented Mar 12, 2026

Summary

  • Implement String.at() ES2022 method — like charAt() but supports negative indices
  • s.at(-1) returns last character, s.at(-2) returns second-to-last, etc.
  • Out-of-bounds indices (positive or negative) return empty string
  • Full bounds checking with no undefined behavior

Test plan

  • New test fixture strings/string-at.ts covers positive, negative, and OOB indices
  • npm run verify:quick passes (tests + Stage 1 self-hosting)

🤖 Generated with Claude Code

@cs01 cs01 merged commit a5a67f3 into main Mar 12, 2026
12 checks passed
@cs01 cs01 deleted the fix/string-at branch March 12, 2026 05:35
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