From fbf6c7fc2bcabc69c16e0006c0c37e27e505d64d Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Mon, 20 Jun 2016 13:22:53 -0400 Subject: [PATCH] Add a manual test for panicking while JS stack frames exist. --- components/script/dom/testbinding.rs | 2 ++ components/script/dom/webidls/TestBinding.webidl | 2 ++ tests/html/panic.html | 16 ++++++++++++++++ 3 files changed, 20 insertions(+) create mode 100644 tests/html/panic.html diff --git a/components/script/dom/testbinding.rs b/components/script/dom/testbinding.rs index bbbbc8aa5d6..8cd53ee57fb 100644 --- a/components/script/dom/testbinding.rs +++ b/components/script/dom/testbinding.rs @@ -580,6 +580,8 @@ impl TestBindingMethods for TestBinding { ptr::write_volatile(p, 0xbaadc0de); } } + + fn Panic(&self) { panic!("explicit panic from script") } } impl TestBinding { diff --git a/components/script/dom/webidls/TestBinding.webidl b/components/script/dom/webidls/TestBinding.webidl index eb6e5a9ae7b..29b5d9e1d71 100644 --- a/components/script/dom/webidls/TestBinding.webidl +++ b/components/script/dom/webidls/TestBinding.webidl @@ -455,6 +455,8 @@ interface TestBinding { static void funcControlledStaticMethodEnabled(); [Func="TestBinding::condition_satisfied"] const unsigned short funcControlledConstEnabled = 0; + + void panic(); }; partial interface TestBinding { diff --git a/tests/html/panic.html b/tests/html/panic.html new file mode 100644 index 00000000000..d9464846d75 --- /dev/null +++ b/tests/html/panic.html @@ -0,0 +1,16 @@ + + + + + + + + + +