FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

src: support (de)serialization of `DOMException` by jazelly · Pull Request #57372 · nodejs/node · GitHub

/ node Public

src: support (de)serialization of DOMException - #57372

Closed
jazelly wants to merge 1 commit into
nodejs:mainfrom
jazelly:serialize-dom-exception
Closed

src: support (de)serialization of DOMException#57372
jazelly wants to merge 1 commit into
nodejs:mainfrom
jazelly:serialize-dom-exception

Conversation

jazelly commented Mar 8, 2025
edited
Loading

Copy link
Copy Markdown
Member

Added serialization and deserialization support for DOMException. Ideally we shouldn't do this in native, but since it's compiled before an Environment exists, we cannot mark it as kCloneable and provide associated serialization methods in JS land.

Fixes: #49181

nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Mar 8, 2025
jazelly force-pushed the serialize-dom-exception branch 2 times, most recently from c73bc7f to b039fee Compare March 8, 2025 03:12

codecov Bot commented Mar 8, 2025
edited
Loading

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 26.82927% with 90 lines in your changes missing coverage. Please review.

Project coverage is 90.10%. Comparing base (3a497dc) to head (ee1dacf).
Report is 14 commits behind head on main.

Files with missing lines Patch % Lines
src/node_messaging.cc 26.82% 83 Missing and 7 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #57372      +/-   ##
==========================================
- Coverage   90.22%   90.10%   -0.12%     
==========================================
  Files         630      630              
  Lines      185259   185332      +73     
  Branches    36245    36247       +2     
==========================================
- Hits       167143   166998     -145     
- Misses      11063    11285     +222     
+ Partials     7053     7049       -4     
Files with missing lines Coverage Δ
src/node_messaging.cc 77.59% <26.82%> (-5.88%) ⬇️

... and 46 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.

jazelly force-pushed the serialize-dom-exception branch 2 times, most recently from 0aec3cf to 96f824c Compare March 8, 2025 08:42
jazelly requested review from addaleax and legendecas March 9, 2025 07:34
jazelly added the request-ci Add this label to start a Jenkins CI on a PR. label Mar 9, 2025
jazelly requested a review from joyeecheung March 9, 2025 21:21
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Mar 9, 2025

Copy link
Copy Markdown
Collaborator

legendecas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Private symbols are per-isolate data and initialized before an Environment is created (in IsolateData). It does not depend on an Environment. Yet, it needs a bit of refactor on the NewContext and GetPerContextExports so that InitializePrimordials can access the private symbols.

Comment thread src/node_messaging.cc Outdated
Comment thread src/node_messaging.cc Outdated
Comment thread src/node_messaging.cc Outdated
Comment thread src/node_messaging.cc Outdated
jazelly force-pushed the serialize-dom-exception branch from 947742c to ee1dacf Compare March 10, 2025 13:12
jazelly marked this pull request as draft March 10, 2025 13:20

jazelly commented Mar 11, 2025
edited
Loading

Copy link
Copy Markdown
Member Author

Yet, it needs a bit of refactor on the NewContext and GetPerContextExports so that InitializePrimordials can access the private symbols

IIUC, we need to pass isolate_data into these so that we can get private symbols and other symbols without env

jazelly force-pushed the serialize-dom-exception branch from 440dcd7 to cded81b Compare March 14, 2025 12:08

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Maybe use class property syntax to set this using [[Define]] semantics?

class DOMException {
	[is_dom_exception] = true;

	constructor(message = '', options = 'Error') {
		...
	}
}

jazelly force-pushed the serialize-dom-exception branch from cded81b to 2ec57d7 Compare March 15, 2025 06:02

jazelly commented Mar 15, 2025

Copy link
Copy Markdown
Member Author

Opened #57479 to help tackle this. That one, as the first step, works fine, but I need a bit of time working on this, as with current manual (de)serialize approach there is a stackTrace problem when posting DOMException to worker. I will try

  1. expose symbols as well so that we can use the combination of tranfer_mode_private_symbol + kClone + kDeserialize
  2. figure out why stackTrace cannot be inferred by V8 in worker.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stucturedClone defective for DataCloneError

5 participants


Back | FazBrowse Home | New Git URL