From f952d7ce0a1fcae485fa6728b9c3237f7e5f9e66 Mon Sep 17 00:00:00 2001 From: CYBAI Date: Sun, 24 Jun 2018 18:32:17 +0800 Subject: [PATCH] Clear consumed rejections and add FIXME comments --- components/script/script_runtime.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/components/script/script_runtime.rs b/components/script/script_runtime.rs index b128e3e54b5..2ab4ef986f0 100644 --- a/components/script/script_runtime.rs +++ b/components/script/script_runtime.rs @@ -256,6 +256,13 @@ pub fn notify_about_rejected_promises(global: &GlobalScope) { global.upcast(), ).unwrap(); } + + if global.get_consumed_rejections().borrow().len() > 0 { + // FIXME(cybai): Implement `rejectionhandled` event instead of clearing the whole + // consumed rejections + // https://html.spec.whatwg.org/multipage/#the-hostpromiserejectiontracker-implementation + global.get_consumed_rejections().borrow_mut().clear(); + } } }