Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 34ccaa804ca9993edac87aa7631f26c73a018f39
https://github.com/WebKit/WebKit/commit/34ccaa804ca9993edac87aa7631f26c73a018f39
Author: Yusuke Suzuki <[email protected]>
Date: 2026-09-17 (Thu, 17 Sep 2026)
Changed paths:
A JSTests/stress/structured-clone-transfer.js
A JSTests/stress/structured-clone.js
M Source/JavaScriptCore/jsc.cpp
M Source/JavaScriptCore/runtime/CloneDeserializerBase.h
Log Message:
-----------
[JSC] Add structuredClone to jsc shell and add more tests
https://bugs.webkit.org/show_bug.cgi?id=324474
rdar://187713459
Reviewed by Tadeu Zagallo, Keith Miller, and Vassili Bykov.
This patch adds structuredClone[1] function to jsc shell. This
implements the spec[2]'s behavior. It allows us to test CloneSerializer
and CloneDeserializer more easily. $262 offers broadcast function which
utilizes them, but still swallows some missing error checks due to its
thread sneding characteristics (in particular, deserializer side because
of capturing it in a different thread). Having structuredClone increases
the test coverage of CloneSerializer and CloneDeserializer.
[1]: https://developer.mozilla.org/en-US/docs/Web/API/Window/structuredClone
[2]:
https://html.spec.whatwg.org/multipage/structured-data.html#dom-structuredclone
Tests: JSTests/stress/structured-clone-transfer.js
JSTests/stress/structured-clone.js
* JSTests/stress/structured-clone-transfer.js: Added.
(shouldBe):
(shouldThrow):
(throw.new.Error):
(shouldBe.let.generator):
(shouldBe.shouldThrow):
(shouldBe.get shouldBe):
(shouldBe.let.value.get detacher):
(shouldThrow.get shouldThrow):
* JSTests/stress/structured-clone.js: Added.
(shouldBe):
(shouldThrow):
(throw.new.Error):
(shouldBe.let.set structuredClone):
(shouldBe.set shouldBe):
(prototype.method):
(shouldBe.get shouldBe):
(get shouldThrow):
* Source/JavaScriptCore/jsc.cpp:
(JSC_DEFINE_HOST_FUNCTION):
* Source/JavaScriptCore/runtime/CloneDeserializerBase.h:
(JSC::CloneDeserializerBase::readArrayBufferViewImpl):
Canonical link: https://commits.webkit.org/321349@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications