豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

fix(ext/console): support iterators in console.table#32379

Merged
bartlomieju merged 1 commit intodenoland:mainfrom
bartlomieju:fix/console-table-iterators
Mar 2, 2026
Merged

fix(ext/console): support iterators in console.table#32379
bartlomieju merged 1 commit intodenoland:mainfrom
bartlomieju:fix/console-table-iterators

Conversation

@bartlomieju
Copy link
Copy Markdown
Member

Summary

  • Fix console.table to properly display data when given iterator objects (e.g., map.entries(), map.values(), set.values())
  • Previously iterators rendered as empty tables because ObjectKeys returns nothing useful for iterator objects
  • Detects iterables via Symbol.iterator and converts them to arrays before rendering

Closes #20725

Test plan

  • Added unit tests for Map.entries(), Map.values(), and Set.values() iterators passed to console.table
  • Verified existing console.table tests still pass

🤖 Generated with Claude Code

Fixes console.table to properly display data when given iterator objects
(e.g., map.entries(), map.values(), set.values()). Previously, iterators
would render as empty tables since ObjectKeys returns nothing useful for
iterator objects.

Closes denoland#20725

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@bartlomieju bartlomieju merged commit 9c81a23 into denoland:main Mar 2, 2026
112 checks passed
@bartlomieju bartlomieju deleted the fix/console-table-iterators branch March 2, 2026 08:34
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.

console.table can not handle iterator objects

2 participants