| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../http/tests/inspector/console-test.js"></script> | 4 <script src="../../http/tests/inspector/console-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 | 6 |
| 7 function test() | 7 function evalSource(name) |
| 8 { | |
| 9 InspectorTest.reloadPage(function() { | |
| 10 InspectorTest.expandConsoleMessages(); | |
| 11 InspectorTest.dumpConsoleMessages(); | |
| 12 InspectorTest.completeTest(); | |
| 13 }); | |
| 14 } | |
| 15 | |
| 16 function evalSource() | |
| 17 { | 8 { |
| 18 function b() | 9 function b() |
| 19 { | 10 { |
| 20 throw new Error("Exception in eval."); | 11 throw new Error("Exception in eval:" + name); |
| 21 } | 12 } |
| 22 | 13 |
| 23 function a() | 14 function a() |
| 24 { | 15 { |
| 25 b(); | 16 b(); |
| 26 } | 17 } |
| 27 | 18 |
| 28 a(); | 19 a(); |
| 29 } | 20 } |
| 30 | 21 |
| 31 eval("(" + evalSource + ")()//# sourceURL=evalURL.js"); | 22 function doEvalWithSourceURL() |
| 23 { |
| 24 var source = "(" + evalSource + ")(\"with sourceURL\")//# sourceURL=evalURL.
js"; |
| 25 setTimeout(eval.bind(this, source), 0); |
| 26 } |
| 27 |
| 28 function doAnonymousEvalWith() |
| 29 { |
| 30 var source = "(" + evalSource + ")(\"anonymous\")"; |
| 31 setTimeout(eval.bind(this, source), 0); |
| 32 } |
| 33 |
| 34 function test() |
| 35 { |
| 36 InspectorTest.evaluateInPage("doEvalWithSourceURL()", step2.bind(this)); |
| 37 |
| 38 function step2() |
| 39 { |
| 40 InspectorTest.evaluateInPage("doAnonymousEvalWith()", step3.bind(this)); |
| 41 } |
| 42 |
| 43 function step3() |
| 44 { |
| 45 if (WebInspector.consoleView._visibleMessagesIndices < 2) |
| 46 InspectorTest.addConsoleSniffer(step3); |
| 47 else |
| 48 step4(); |
| 49 } |
| 50 |
| 51 function step4() |
| 52 { |
| 53 InspectorTest.expandConsoleMessages(); |
| 54 InspectorTest.dumpConsoleMessages(); |
| 55 InspectorTest.completeTest(); |
| 56 } |
| 57 } |
| 32 | 58 |
| 33 </script> | 59 </script> |
| 34 </head> | 60 </head> |
| 35 | 61 |
| 36 <body onload="runTest()"> | 62 <body onload="runTest()"> |
| 37 <p> | 63 <p> |
| 38 Tests that when uncaught exception in eval'ed script ending | 64 Tests that when uncaught exception in eval'ed script ending |
| 39 with //# sourceURL=url is logged into console, its stack trace | 65 with //# sourceURL=url is logged into console, its stack trace |
| 40 will have the url as the script source. <a href="https://bugs.webkit.org/show_bu
g.cgi?id=47252">Bug 47252.</a> | 66 will have the url as the script source. <a href="https://bugs.webkit.org/show_bu
g.cgi?id=47252">Bug 47252.</a> |
| 41 </p> | 67 </p> |
| 42 | 68 |
| 43 </body> | 69 </body> |
| 44 </html> | 70 </html> |
| OLD | NEW |