From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- .../debugger/test/mochitest/examples/exceptions.js | 88 ++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 devtools/client/debugger/test/mochitest/examples/exceptions.js (limited to 'devtools/client/debugger/test/mochitest/examples/exceptions.js') diff --git a/devtools/client/debugger/test/mochitest/examples/exceptions.js b/devtools/client/debugger/test/mochitest/examples/exceptions.js new file mode 100644 index 0000000000..9901fe9775 --- /dev/null +++ b/devtools/client/debugger/test/mochitest/examples/exceptions.js @@ -0,0 +1,88 @@ +function uncaughtException() { + throw "unreachable" +} + +function caughtException() { + try { + throw "reachable"; + } catch (e) { + debugger; + } +} + +function deepError() { + function a() { b(); } + function b() { c(); } + function c() { throw new Error(); } + + try { + a(); + } catch (e) {} + + debugger; +} + +function deepErrorFinally() { + function a() { b(); } + function b() { + try { + c(); + } finally { + debugger; + } + } + function c() { throw new Error(); } + + try { + a(); + } catch (e) {} + + debugger; +} + +function deepErrorCatch() { + function a() { b(); } + function b() { + try { + c(); + } catch (e) { + debugger; + throw e; + } + } + function c() { throw new Error(); } + + try { + a(); + } catch (e) {} + + debugger; +} + +function deepErrorThrowDifferent() { + function a() { b(); } + function b() { + try { + c(); + } catch (e) { + throw new Error(); + } + } + function c() { throw new Error(); } + + try { + a(); + } catch (e) {} + + debugger; +} + +function throwInNewFunctionArgument() { + new Function("f=doesntExists()", "return 42;")(); +} + +function inlineExc() { + 'abc'.push(1); +} + +inlineExc(); -- cgit v1.2.3