Skip to content

fix: map<string, number>.set() and charat/charcodeat default args#280

Merged
cs01 merged 2 commits intomainfrom
fix/string-method-default-args
Mar 12, 2026
Merged

fix: map<string, number>.set() and charat/charcodeat default args#280
cs01 merged 2 commits intomainfrom
fix/string-method-default-args

Conversation

@cs01
Copy link
Copy Markdown
Owner

@cs01 cs01 commented Mar 12, 2026

Summary

  • Map<string, number>.set() regression fix: The native compiler miscompiled the charAt(0) numeric literal detection in generateStringMapSet, causing store i8* 0.5 (invalid IR) instead of boxing the double. Fix: pass the declared value type ("number") from dispatchStringMapMethod through to generateStringMapSet, bypassing string-based detection entirely.
  • charAt()/charCodeAt() default args: Per JS spec, both methods default to index 0 when called with no arguments. Previously they required exactly 1 argument.

Test plan

  • map-string-number-param.ts now passes with native compiler (was failing with invalid IR)
  • New string-charat-default.ts fixture tests 0-arg and 1-arg forms
  • npm run verify:quick passes (all tests + Stage 1 self-hosting)

🤖 Generated with Claude Code

@cs01 cs01 merged commit 198ecbd into main Mar 12, 2026
12 checks passed
@cs01 cs01 deleted the fix/string-method-default-args branch March 12, 2026 06:59
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