1 description('This test exercises the source URL and line number that is embedded in JavaScript exceptions, which is displayed in places like the JavaScript console.');
3 function exceptionInFunction()
11 // Raises an exception that gets picked up by KJS_CHECKEXCEPTION
12 document.documentElement.innerHTML(foo);
16 shouldBe("typeof e.sourceURL", '"string"');
17 shouldBe("e.line", '12');
21 // Raises an exception that gets picked up by KJS_CHECKEXCEPTIONVALUE
22 document.documentElement.appendChild('').prefix = '';
26 shouldBe("typeof e.sourceURL", '"string"');
27 shouldBe("e.line", '22');
31 // Raises an exception that gets picked up by KJS_CHECKEXCEPTIONREFERENCE
32 document.documentElement.appendChild('').innerHTML = '';
36 shouldBe("typeof e.sourceURL", '"string"');
37 shouldBe("e.line", '32');
41 // Raises an exception that gets picked up by KJS_CHECKEXCEPTIONLIST
42 document.getElementById(1());
46 shouldBe("typeof e.sourceURL", '"string"');
47 shouldBe("e.line", '42');
50 // Raises an exception inside a function to check that its line number
51 // isn't overwritten in the assignment node.
53 var a = exceptionInFunction();
57 shouldBe("typeof e.sourceURL", '"string"');
58 shouldBe("e.line", '5');
70 shouldBe("typeof e.sourceURL", '"string"');
71 shouldBe("e.line", '64');