lib: avoid unsafe array iteration in cli table by HoonDongKang · Pull Request #65838 · nodejs/node · GitHub
Skip to content

lib: avoid unsafe array iteration in cli table - #65838

Open
HoonDongKang wants to merge 1 commit into
nodejs:mainfrom
HoonDongKang:lib-avoid-unsafe-array-iteration
Open

lib: avoid unsafe array iteration in cli table#65838
HoonDongKang wants to merge 1 commit into
nodejs:mainfrom
HoonDongKang:lib-avoid-unsafe-array-iteration

Conversation

@HoonDongKang

Copy link
Copy Markdown
Contributor

for...of relies on the user-mutable Array.prototype[Symbol.iterator], resulting in unsafe array iteration.

This replaces it with an index-based loop when rendering table rows.

Refs

Tests:

  • ./node test/parallel/test-console-table.js

Avoid unsafe array iteration because for...of relies on the
user-mutable Symbol.iterator. Use an index-based loop instead.

Signed-off-by: HoonDongKang <d159123@naver.com>
@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Sep 6, 2026
@codecov

codecov Bot commented Sep 6, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants