|
1 <!-- Any copyright is dedicated to the Public Domain. |
|
2 http://creativecommons.org/publicdomain/zero/1.0/ --> |
|
3 <!doctype html> |
|
4 |
|
5 <html> |
|
6 <head> |
|
7 <meta charset="utf-8"/> |
|
8 <title>Debugger test page</title> |
|
9 </head> |
|
10 |
|
11 <body> |
|
12 <button id="return">Return me!</button> |
|
13 <button id="throw">Throw me!</button> |
|
14 |
|
15 <script type="text/javascript"> |
|
16 function normal(aArg) { |
|
17 debugger; |
|
18 var r = 10; |
|
19 return r; |
|
20 } |
|
21 |
|
22 function error(aArg) { |
|
23 function inner(aArg) { |
|
24 debugger; |
|
25 var r = 10; |
|
26 throw "boom"; |
|
27 return r; |
|
28 } |
|
29 try { |
|
30 inner(aArg); |
|
31 } catch (e) {} |
|
32 } |
|
33 |
|
34 var normalBtn = document.getElementById("return"); |
|
35 normalBtn.addEventListener("click", normal, false); |
|
36 |
|
37 var throwBtn = document.getElementById("throw"); |
|
38 throwBtn.addEventListener("click", error, false); |
|
39 </script> |
|
40 </body> |
|
41 |
|
42 </html> |