-
Notifications
You must be signed in to change notification settings - Fork 3.8k
fix(console): properly identify Generator and AsyncGenerator in conso… #25324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix(console): properly identify Generator and AsyncGenerator in conso… #25324
Conversation
…le.log Fixes oven-sh#18324 Previously, Generator and AsyncGenerator objects were falling through to the default JSON formatter, causing them to display as '{}' instead of their proper type identifiers. Node.js displays these as: - Generator: 'Object [Generator] {}' - AsyncGenerator: 'Object [AsyncGenerator] {}' This change adds: 1. Generator and AsyncGenerator tags to the Formatter.Tag enum 2. Type mappings from JSType.Generator/AsyncGenerator to the new tags 3. Formatters that output the proper 'Object [Generator/AsyncGenerator] {}' format This matches Node.js behavior for consistency.
WalkthroughAdds support for Generator and AsyncGenerator types to the console object formatter. Two new enum variants are added to Changes
Suggested reviewers
Pre-merge checks✅ Passed checks (4 passed)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (3)src/**/*.{cpp,zig}📄 CodeRabbit inference engine (.cursor/rules/building-bun.mdc)
Files:
src/**/*.zig📄 CodeRabbit inference engine (.cursor/rules/building-bun.mdc)
Files:
**/*.zig📄 CodeRabbit inference engine (.cursor/rules/zig-javascriptcore-classes.mdc)
Files:
🧠 Learnings (13)📓 Common learnings📚 Learning: 2025-11-24T18:36:08.558ZApplied to files:
📚 Learning: 2025-10-01T21:59:54.571ZApplied to files:
📚 Learning: 2025-11-24T18:35:39.205ZApplied to files:
📚 Learning: 2025-11-24T18:36:08.558ZApplied to files:
📚 Learning: 2025-10-18T20:50:47.750ZApplied to files:
📚 Learning: 2025-11-24T18:35:39.205ZApplied to files:
📚 Learning: 2025-10-04T21:17:53.040ZApplied to files:
📚 Learning: 2025-11-24T18:35:39.205ZApplied to files:
📚 Learning: 2025-11-24T18:36:59.706ZApplied to files:
📚 Learning: 2025-11-24T18:35:25.883ZApplied to files:
📚 Learning: 2025-10-01T22:13:08.081ZApplied to files:
📚 Learning: 2025-11-24T18:35:25.883ZApplied to files:
🔇 Additional comments (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…le.log
Fixes #18324
Previously, Generator and AsyncGenerator objects were falling through to the default JSON formatter, causing them to display as '{}' instead of their proper type identifiers.
Node.js displays these as:
This change adds:
This matches Node.js behavior for consistency.
What does this PR do?
Adds proper console.log formatting for Generator and AsyncGenerator objects to match Node.js behavior. Previously these displayed as
{}, now they display asObject [Generator] {}andObject [AsyncGenerator] {}.How did you verify your code works?
Code analysis of the existing patterns in ConsoleObject.zig - the fix follows the same pattern used for MapIterator, SetIterator, and other similar types. CI tests will verify the implementation.