diff options
author | Jerens Lensun <54782057+jerensl@users.noreply.github.com> | 2025-04-14 02:10:04 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-13 18:10:04 +0000 |
commit | d5284dfad9ee90a3cf689f41e8bddf8c98567a3f (patch) | |
tree | 4b823fd9928f48342df8f8c41c1d311472b363a8 /components/script/dom/messageport.rs | |
parent | 740a94ef20e0a1e5f4393152554cee92ba89e28f (diff) | |
download | servo-d5284dfad9ee90a3cf689f41e8bddf8c98567a3f.tar.gz servo-d5284dfad9ee90a3cf689f41e8bddf8c98567a3f.zip |
Support optional message for dataclone error (#36308)
- [x] our [DataClone
error](https://github.com/servo/servo/blob/d733abfca02cdb9fd2af4f0d82ff050e25f71829/components/script/dom/bindings/error.rs#L80)
needs to support an optional message
- [x] we need to add support to our DOMException implementation to allow
an optional message to replace the default message
- [x] we need to create a new struct used by both StructuredDataReader
and StructuredDataWriter for storing the error message in the
report_error_callback
- [x] report_error_callback needs to cast the closure pointer to the new
struct
- [x] the code that [throws a DataClone
error](https://github.com/servo/servo/blob/5d1c64dba9cf3e65f770370eb17f00ad4114edce/components/script/dom/bindings/structuredclone.rs#L542)
needs to use the stored error message if it's available
Testing: *Describe how this pull request is tested or why it doesn't
require tests*
Fixes: #36191
---------
Signed-off-by: jerensl <54782057+jerensl@users.noreply.github.com>
Diffstat (limited to 'components/script/dom/messageport.rs')
-rw-r--r-- | components/script/dom/messageport.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/components/script/dom/messageport.rs b/components/script/dom/messageport.rs index 8addfe0731f..d299ab8156f 100644 --- a/components/script/dom/messageport.rs +++ b/components/script/dom/messageport.rs @@ -119,7 +119,7 @@ impl MessagePort { for port in ports { // Step 2 if port.message_port_id() == self.message_port_id() { - return Err(Error::DataClone); + return Err(Error::DataClone(None)); } // Step 4 |