Skip to content

fix(ext/crypto): support structuredClone for CryptoKey#32674

Merged
bartlomieju merged 6 commits intodenoland:mainfrom
bartlomieju:fix/cryptokey-structured-clone
Mar 13, 2026
Merged

fix(ext/crypto): support structuredClone for CryptoKey#32674
bartlomieju merged 6 commits intodenoland:mainfrom
bartlomieju:fix/cryptokey-structured-clone

Conversation

@bartlomieju
Copy link
Copy Markdown
Member

@bartlomieju bartlomieju commented Mar 12, 2026

Summary

Closes #12734

Uses the cloneable resource registry from denoland#32672 to enable structured
cloning of CryptoKey objects. This allows CryptoKeys (including
non-extractable ones) to be passed to Workers via postMessage and
cloned with structuredClone().

Closes denoland#12734

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
bartlomieju and others added 5 commits March 12, 2026 22:58
Uses the cloneable resource registry to enable structured cloning of
DOMException objects. Serializes message, name, and stack; code is
derived from name on deserialization.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The hostObjectBrand symbol property was enumerable, causing Node's
deepStrictEqual to compare the function instances and fail since each
object has a different closure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@bartlomieju bartlomieju changed the title fix(crypto): support structuredClone for CryptoKey fix(ext/crypto): support structuredClone for CryptoKey Mar 13, 2026
@bartlomieju bartlomieju merged commit 7fa991e into denoland:main Mar 13, 2026
113 checks passed
@bartlomieju bartlomieju deleted the fix/cryptokey-structured-clone branch March 13, 2026 09:50
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.

Cannot use structuredClone on CryptoKey

2 participants