Streams: remove unnecessary special hanlding of dataclone error (#36628)

This removes a now unnecessary handling of dataclone error when port
posts a message handling error to support stream transfers.

Fix https://github.com/servo/servo/issues/36479

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
This commit is contained in:
Gregory Terzian 2025-04-21 16:31:25 +08:00 committed by GitHub
parent 233c9aaea6
commit a0419faa85
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 19 deletions

View file

@ -2088,19 +2088,8 @@ impl CrossRealmTransformReadable {
// Otherwise, if type is "error",
if type_string == "error" {
if value.is_undefined() {
// Note: for DataClone errors, we send UndefinedValue across,
// because somehow sending the error results in another error.
// The error is then created here.
rooted!(in(*cx) let mut rooted_error = UndefinedValue());
Error::DataClone(None).to_jsval(cx, global, rooted_error.handle_mut(), can_gc);
// Perform ! ReadableStreamDefaultControllerError(controller, value).
self.controller.error(rooted_error.handle(), can_gc);
} else {
// Perform ! ReadableStreamDefaultControllerError(controller, value).
self.controller.error(value.handle(), can_gc);
}
// Perform ! ReadableStreamDefaultControllerError(controller, value).
self.controller.error(value.handle(), can_gc);
// Disentangle port.
global.disentangle_port(port);