From a7701c9abd26f5a23e5a885e5a29da46b01f9420 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 95341751780..745a141efe7 100644 --- a/components/script/dom/testbinding.rs +++ b/components/script/dom/testbinding.rs @@ -571,6 +571,8 @@ impl TestBindingMethods for TestBinding { fn FuncControlledAttributeEnabled(&self) -> bool { false } fn FuncControlledMethodDisabled(&self) {} fn FuncControlledMethodEnabled(&self) {} + + 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 cdfb9fd18ae..c8796a024a6 100644 --- a/components/script/dom/webidls/TestBinding.webidl +++ b/components/script/dom/webidls/TestBinding.webidl @@ -455,4 +455,6 @@ interface TestBinding { static void funcControlledStaticMethodEnabled(); [Func="TestBinding::condition_satisfied"] const unsigned short funcControlledConstEnabled = 0; + + void panic(); }; 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 @@ + + + + + + + + + +