Skip to content

worker: add Symbol.toStringTag to messaging classes - #65532

Open
lazerg wants to merge 2 commits into
nodejs:mainfrom
lazerg:fix/issue-65527-messageport-tostringtag
Open

lazerg wants to merge 2 commits into
nodejs:mainfrom
lazerg:fix/issue-65527-messageport-tostringtag

Conversation

@lazerg

@lazerg lazerg commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

MessageChannel, MessagePort and BroadcastChannel had no
Symbol.toStringTag, so Object.prototype.toString.call() returned
[object Object] or [object EventTarget] rather than the interface
names.

Two existing tests expected util.inspect() to print
MessagePort [EventTarget]; the tag now matches the constructor name,
so the bracketed part is gone.

Fixes: #65527

Signed-off-by: Lazizbek Ergashev <lazerg2@gmail.com>
@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. worker Issues and PRs related to the worker_threads module and Worker API. labels Aug 25, 2026
@codecov

codecov Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.65%. Comparing base (4b5e86c) to head (070a5ec).
⚠️ Report is 435 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #65532      +/-   ##
==========================================
+ Coverage   90.14%   91.65%   +1.51%     
==========================================
  Files         751      789      +38     
  Lines      253679   285455   +31776     
  Branches    47789    69104   +21315     
==========================================
+ Hits       228671   261635   +32964     
+ Misses      16264    14430    -1834     
- Partials     8744     9390     +646     
Files with missing lines Coverage Δ
lib/internal/worker/io.js 99.23% <100.00%> (+0.03%) ⬆️

... and 283 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: Lazizbek Ergashev <lazerg2@gmail.com>
@lazerg lazerg changed the title worker: add Symbol.toStringTag to MessageChannel and MessagePort worker: add Symbol.toStringTag to messaging classes Aug 25, 2026
@brettz9

brettz9 commented Sep 15, 2026

Copy link
Copy Markdown

Could the failure be flake, remedied by another test run?

@lazerg

lazerg commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

The failure does not come from this change. wpt/test-web-locks crashed on macOS after all of its subtests passed. That matches the known flake in #59142, where held.https.any.js throws an expected rejection and the harness does not register it. test/wpt/status/web-locks.json already marks that file flaky, and its note covers ppc, linux x64 and s390x only. The same commit passed test-linux on both arches, which runs the same WPT suite, and my diff only defines Symbol.toStringTag on the three messaging classes. A new run should come back green, but I cannot start one here.

@panva panva closed this Sep 15, 2026
@panva panva reopened this Sep 15, 2026
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. worker Issues and PRs related to the worker_threads module and Worker API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Symbol.toStringTag on MessageChannel and MessagePort

5 participants