mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Make DOMException serializable (#36535)
Follow the implementation of making DOMPoint and DOMPointReadOnly serializable in PR #35989 Testing: Passed a test previously expected to fail. Fixes: #36463 --------- Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
This commit is contained in:
parent
cc04caa8ce
commit
dacd951c9f
6 changed files with 138 additions and 12 deletions
|
@ -196,6 +196,7 @@ impl PipelineNamespace {
|
|||
self, ServiceWorkerRegistrationIndex}
|
||||
namespace_id_method! {next_blob_id, BlobId, self, BlobIndex}
|
||||
namespace_id_method! {next_dom_point_id, DomPointId, self, DomPointIndex}
|
||||
namespace_id_method! {next_dom_exception_id, DomExceptionId, self, DomExceptionIndex}
|
||||
}
|
||||
|
||||
thread_local!(pub static PIPELINE_NAMESPACE: Cell<Option<PipelineNamespace>> = const { Cell::new(None) });
|
||||
|
@ -425,6 +426,19 @@ impl DomPointId {
|
|||
}
|
||||
}
|
||||
|
||||
namespace_id! {DomExceptionId, DomExceptionIndex, "DomException"}
|
||||
|
||||
impl DomExceptionId {
|
||||
pub fn new() -> DomExceptionId {
|
||||
PIPELINE_NAMESPACE.with(|tls| {
|
||||
let mut namespace = tls.get().expect("No namespace set for this thread!");
|
||||
let next_exception_id = namespace.next_dom_exception_id();
|
||||
tls.set(Some(namespace));
|
||||
next_exception_id
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
namespace_id! {HistoryStateId, HistoryStateIndex, "HistoryState"}
|
||||
|
||||
impl HistoryStateId {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue