Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work around firefox webextensions bug #249

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions crates/timers/src/callback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ extern "C" {
#[wasm_bindgen(js_name = "setInterval", catch)]
fn set_interval(handler: &Function, timeout: i32) -> Result<i32, JsValue>;

#[wasm_bindgen(js_name = "clearTimeout")]
fn clear_timeout(handle: i32);
#[wasm_bindgen(js_name = "clearTimeout", catch)]
fn clear_timeout(handle: i32) -> Result<(), JsValue>;

#[wasm_bindgen(js_name = "clearInterval")]
fn clear_interval(handle: i32);
#[wasm_bindgen(js_name = "clearInterval", catch)]
fn clear_interval(handle: i32) -> Result<(), JsValue>;
}

/// A scheduled timeout.
Expand All @@ -35,7 +35,7 @@ pub struct Timeout {
impl Drop for Timeout {
fn drop(&mut self) {
if let Some(id) = self.id {
clear_timeout(id);
clear_timeout(id).unwrap_throw();
}
}
}
Expand Down Expand Up @@ -135,7 +135,7 @@ pub struct Interval {
impl Drop for Interval {
fn drop(&mut self) {
if let Some(id) = self.id {
clear_interval(id);
clear_interval(id).unwrap_throw();
}
}
}
Expand Down