| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <head> | |
| 3 <script src="resources/profiler-test-JS-resources.js"></script> | |
| 4 <script> | |
| 5 if (window.testRunner) | |
| 6 testRunner.dumpAsText(); | |
| 7 if (window.internals) | |
| 8 internals.setJavaScriptProfilingEnabled(true); | |
| 9 | |
| 10 function function0() | |
| 11 { | |
| 12 for (var i = 0; i < 0; ++i) ; | |
| 13 } | |
| 14 | |
| 15 function0.displayName = "0 iterations function"; | |
| 16 | |
| 17 function function1() | |
| 18 { | |
| 19 for (var i = 0; i < 1; ++i) ; | |
| 20 } | |
| 21 | |
| 22 function1.displayName = "1 iteration function"; | |
| 23 | |
| 24 function function2() | |
| 25 { | |
| 26 for (var i = 0; i < 2; ++i) ; | |
| 27 } | |
| 28 | |
| 29 function2.displayName = "2 iterations function"; | |
| 30 | |
| 31 function function20() | |
| 32 { | |
| 33 for (var i = 0; i < 20; ++i) ; | |
| 34 } | |
| 35 | |
| 36 function20.displayName = "20 iterations function"; | |
| 37 | |
| 38 function function1000() | |
| 39 { | |
| 40 for (var i = 0; i < 1000; ++i) ; | |
| 41 } | |
| 42 | |
| 43 function1000.displayName = "1000 iterations function"; | |
| 44 | |
| 45 | |
| 46 function bogusDisplayNameFunction() | |
| 47 { | |
| 48 for (var i = 0; i < 0; ++i) ; | |
| 49 } | |
| 50 | |
| 51 bogusDisplayNameFunction.displayName = bogusDisplayNameFunction; | |
| 52 | |
| 53 function startTest() | |
| 54 { | |
| 55 console.profile("Named functions with display names"); | |
| 56 | |
| 57 function0(); | |
| 58 function1(); | |
| 59 function2(); | |
| 60 function20(); | |
| 61 function1000(); | |
| 62 bogusDisplayNameFunction(); | |
| 63 | |
| 64 endTest(); | |
| 65 } | |
| 66 </script> | |
| 67 </head> | |
| 68 | |
| 69 <body onload="startTest()"> | |
| 70 This page's JavaScript calls named functions and changes their display names. | |
| 71 <br> | |
| 72 <br> | |
| 73 To run this test manually, load it in the browser then load the WebInspector and
look at | |
| 74 the profile. You should see functions named "[x] iteration[s] function", and no
t "function[x]" | |
| 75 <div id="output"></div> | |
| 76 </body> | |
| 77 </html> | |
| OLD | NEW |