Skip to content

feat: console.log prints booleans/null correctly, fix JSON.stringify format#205

Merged
cs01 merged 7 commits intomainfrom
console-log-any
Mar 11, 2026
Merged

feat: console.log prints booleans/null correctly, fix JSON.stringify format#205
cs01 merged 7 commits intomainfrom
console-log-any

Conversation

@cs01
Copy link
Copy Markdown
Owner

@cs01 cs01 commented Mar 11, 2026

Summary

  • console.log(true) now prints true instead of 1, console.log(false) prints false instead of 0
  • console.log(null) prints null, console.log(undefined) prints undefined (node compiler)
  • JSON.stringify(true) returns "true" instead of "1.000000", JSON.stringify(false) returns "false"
  • JSON.stringify(42) returns "42" instead of "42.000000" (fixed format from %f to %.15g)
  • JSON.stringify(null) returns "null" (node compiler)
  • Boolean variables from function returns also print correctly

Test plan

  • New test: console-log-types.ts — boolean literals and variables
  • New test: json-stringify-bool-null.ts — boolean and number format verification
  • All 465 existing tests pass
  • Self-hosting verification passes (Stage 0 + Stage 1)

🤖 Generated with Claude Code

cs01 and others added 7 commits March 10, 2026 21:30
…ned as undefined

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…, comparisons, booleans

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…as true/false

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@cs01 cs01 force-pushed the console-log-any branch from 8565472 to 2d3762d Compare March 11, 2026 04:36
@cs01 cs01 merged commit 5e5b5f1 into main Mar 11, 2026
12 checks passed
@cs01 cs01 deleted the console-log-any branch March 11, 2026 04:45
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