Skip to content

fix: recognize NaN and Infinity as built-in globals in semantic analyzer#254

Merged
cs01 merged 1 commit intomainfrom
fix/next-safety
Mar 12, 2026
Merged

fix: recognize NaN and Infinity as built-in globals in semantic analyzer#254
cs01 merged 1 commit intomainfrom
fix/next-safety

Conversation

@cs01
Copy link
Copy Markdown
Owner

@cs01 cs01 commented Mar 12, 2026

Summary

  • Programs using NaN or Infinity were rejected with "Reference to undeclared variable" by the semantic analyzer
  • Added recognition of these two JavaScript built-in globals so they pass semantic analysis
  • Added comprehensive safety test exercising array assignment, substr, slice, repeat, modulo, parseInt, Infinity, and NaN

Test plan

  • New test fixture edge-cases/comprehensive-safety.ts passes
  • npm run verify:quick passes (tests + Stage 1 self-hosting)

🤖 Generated with Claude Code

@cs01 cs01 merged commit 3852b19 into main Mar 12, 2026
12 checks passed
@cs01 cs01 deleted the fix/next-safety 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