mirror of
https://github.com/servo/servo
synced 2026-05-03 21:02:19 +02:00
script: Use CString for Error::Type and Error::Range (#42576)
Continuation of https://github.com/servo/servo/pull/42135, switch Error::Type and Error::Range to also use CStrings internally, as they are converted to CString for throwing JS exceptions (other get thrown as DomException object, which uses rust string internally). Changes in script crate are mechanical. Testing: Should be covered by WPT tests. Part of #42126 Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
use dom_struct::dom_struct;
|
||||
use indexmap::IndexMap;
|
||||
use js::rust::HandleObject;
|
||||
use script_bindings::cformat;
|
||||
|
||||
use crate::dom::bindings::cell::DomRefCell;
|
||||
use crate::dom::bindings::codegen::Bindings::TestBindingMaplikeWithInterfaceBinding::TestBindingMaplikeWithInterfaceMethods;
|
||||
@@ -79,7 +80,7 @@ impl TestBindingMaplikeWithInterfaceMethods<crate::DomTypeHolder>
|
||||
self.internal
|
||||
.borrow()
|
||||
.get(&key)
|
||||
.ok_or_else(|| Error::Type(format!("No entry for key {key}")))
|
||||
.ok_or_else(|| Error::Type(cformat!("No entry for key {key}")))
|
||||
.cloned()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user