Skip to content

fix(ext/node): bind Node console methods to global console#32741

Open
bartlomieju wants to merge 1 commit intomainfrom
fix/node-console-compat
Open

fix(ext/node): bind Node console methods to global console#32741
bartlomieju wants to merge 1 commit intomainfrom
fix/node-console-compat

Conversation

@bartlomieju
Copy link
Copy Markdown
Member

Summary

  • Apply Node Console prototype methods to the global console object so that console.log/count/etc. write through process.stdout.write instead of core.print(), matching Node.js behavior when monkey-patching process.stdout.write
  • Fix Console colorMode validation error message to match Node.js ("must be one of: 'auto', true, false")
  • Handle revoked proxies in console formatting to prevent TypeError (early detection via getProxyDetails)
  • Enable 7 additional passing node_compat console tests: test-console.js, test-console-clear.js, test-console-count.js, test-console-issue-43095.js, test-console-methods.js, test-console-stdio-setters.js, test-console-tty-colors.js

Test plan

  • All newly added console compat tests pass (./x test-compat test-console)
  • All previously passing console compat tests still pass
  • CI passes

🤖 Generated with Claude Code

…voked proxy formatting

- Apply Node Console prototype methods to the global console object so that
  console.log/count/etc write through process.stdout.write instead of
  core.print(), matching Node.js behavior
- Fix Console colorMode validation error message to match Node.js
- Handle revoked proxies in console formatting to prevent TypeError
- Enable 7 additional passing node_compat console tests

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@kajukitli kajukitli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed with full repo context. Initial findings didn't hold up on closer inspection. Looks good.

@bartlomieju
Copy link
Copy Markdown
Member Author

I don't think we we will do this. Binding to Node console means everything will use Node's formatting...

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.

2 participants