aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/codegen
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/bindings/codegen')
-rw-r--r--components/script/dom/bindings/codegen/CodegenRust.py15
1 files changed, 3 insertions, 12 deletions
diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py
index cc6e1660fba..9acdea81155 100644
--- a/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/components/script/dom/bindings/codegen/CodegenRust.py
@@ -2383,16 +2383,8 @@ class CGAbstractMethod(CGThing):
if self.catchPanic:
body = CGWrapper(CGIndenter(body),
- pre="let result = panic::catch_unwind(AssertUnwindSafe(|| {\n",
- post=("""}));
-match result {
- Ok(result) => result,
- Err(error) => {
- store_panic_result(error);
- return%s;
- }
-}
-""" % ("" if self.returnType == "void" else " false")))
+ pre="return wrap_panic(|| {\n",
+ post=("""}, %s);""" % ("()" if self.returnType == "void" else "false")))
return CGWrapper(CGIndenter(body),
pre=self.definition_prologue(),
@@ -5567,6 +5559,7 @@ def generate_imports(config, cgthings, descriptors, callbacks=None, dictionaries
'dom::bindings::utils::resolve_global',
'dom::bindings::utils::set_dictionary_property',
'dom::bindings::utils::trace_global',
+ 'dom::bindings::utils::wrap_panic',
'dom::bindings::trace::JSTraceable',
'dom::bindings::trace::RootedTraceable',
'dom::bindings::callback::CallSetup',
@@ -5618,14 +5611,12 @@ def generate_imports(config, cgthings, descriptors, callbacks=None, dictionaries
'libc',
'util::prefs::PREFS',
'script_runtime::maybe_take_panic_result',
- 'script_runtime::store_panic_result',
'std::borrow::ToOwned',
'std::cmp',
'std::mem',
'std::num',
'std::os',
'std::panic',
- 'std::panic::AssertUnwindSafe',
'std::ptr',
'std::str',
'std::rc',