| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <head> | |
| 3 <style> | |
| 4 body { white-space: normal; } | |
| 5 <script src="resources/js-test-pre.js"></script> | |
| 6 </head> | |
| 7 <body> | |
| 8 <script> | |
| 9 description('This test exercises the source URL and line number that is embedded
in JavaScript exceptions, which is displayed in places like the JavaScript cons
ole. It differs from <span style="font-family: monospace;">exception-linenums-i
n-html-1.html</span> in that it only works if <a href="https://bugs.webkit.org/s
how_bug.cgi?id=6314">Bugzilla Bug 6314</a> has been fixed.'); | |
| 10 | |
| 11 function exceptionInFunction() | |
| 12 { | |
| 13 throw Exception(); | |
| 14 } | |
| 15 | |
| 16 var e = undefined; | |
| 17 | |
| 18 try { | |
| 19 // Raises an exception that gets picked up by KJS_CHECKEXCEPTION | |
| 20 document.documentElement.innerHTML(foo); | |
| 21 } catch (exception) { | |
| 22 e = exception; | |
| 23 } | |
| 24 shouldBe("typeof e.sourceURL", '"string"'); | |
| 25 shouldBe("e.line", '23'); | |
| 26 | |
| 27 e = undefined; | |
| 28 try { | |
| 29 // Raises an exception that gets picked up by KJS_CHECKEXCEPTIONVALUE | |
| 30 document.documentElement.appendChild('').prefix = ''; | |
| 31 } catch (exception) { | |
| 32 e = exception; | |
| 33 } | |
| 34 shouldBe("typeof e.sourceURL", '"string"'); | |
| 35 shouldBe("e.line", '33'); | |
| 36 | |
| 37 e = undefined; | |
| 38 try { | |
| 39 // Raises an exception that gets picked up by KJS_CHECKEXCEPTIONREFERENCE | |
| 40 document.documentElement.appendChild('').innerHTML = ''; | |
| 41 } catch (exception) { | |
| 42 e = exception; | |
| 43 } | |
| 44 shouldBe("typeof e.sourceURL", '"string"'); | |
| 45 shouldBe("e.line", '43'); | |
| 46 | |
| 47 e = undefined; | |
| 48 try { | |
| 49 // Raises an exception that gets picked up by KJS_CHECKEXCEPTIONLIST | |
| 50 document.getElementById(1()); | |
| 51 } catch (exception) { | |
| 52 e = exception; | |
| 53 } | |
| 54 shouldBe("typeof e.sourceURL", '"string"'); | |
| 55 shouldBe("e.line", '53'); | |
| 56 | |
| 57 e = undefined; | |
| 58 // Raises an exception inside a function to check that its line number | |
| 59 // isn't overwritten in the assignment node. | |
| 60 try { | |
| 61 var a = exceptionInFunction(); | |
| 62 } catch (exception) { | |
| 63 e = exception; | |
| 64 } | |
| 65 shouldBe("typeof e.sourceURL", '"string"'); | |
| 66 shouldBe("e.line", '16'); | |
| 67 </script> | |
| 68 <script src="resources/js-test-post.js"></script> | |
| 69 </body> | |
| 70 </html> | |
| OLD | NEW |