| 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> | 4 <script> |
| 5 | 5 |
| 6 function test() | 6 function test() |
| 7 { | 7 { |
| 8 InspectorTest.runTestSuite([ | 8 InspectorTest.runTestSuite([ |
| 9 function testFunctionArguments(next) | 9 function testFunctionArguments(next) |
| 10 { | 10 { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 function testNestedFunction3(next) | 49 function testNestedFunction3(next) |
| 50 { | 50 { |
| 51 extract("function foo() { var a = x => x * 2 }", next); | 51 extract("function foo() { var a = x => x * 2 }", next); |
| 52 }, | 52 }, |
| 53 ]); | 53 ]); |
| 54 | 54 |
| 55 function extract(text, next) | 55 function extract(text, next) |
| 56 { | 56 { |
| 57 InspectorTest.addResult("Text:"); | 57 InspectorTest.addResult("Text:"); |
| 58 InspectorTest.addResult(" " + text + "\n"); | 58 InspectorTest.addResult(" " + text + "\n"); |
| 59 Common.formatterWorkerPool.runTask("javaScriptIdentifiers", {content: te
xt}) | 59 Common.formatterWorkerPool.javaScriptIdentifiers(text) |
| 60 .then(onIdentifiers) | 60 .then(onIdentifiers) |
| 61 .then(next); | 61 .then(next); |
| 62 } | 62 } |
| 63 | 63 |
| 64 function onIdentifiers(event) | 64 function onIdentifiers(ids) |
| 65 { | 65 { |
| 66 var ids = event ? event.data : []; | |
| 67 InspectorTest.addResult("Identifiers:"); | 66 InspectorTest.addResult("Identifiers:"); |
| 68 for (var id of ids) | 67 for (var id of ids) |
| 69 InspectorTest.addResult(` id: ${id.name} offset: ${id.offset}`
); | 68 InspectorTest.addResult(` id: ${id.name} offset: ${id.offset}`
); |
| 70 } | 69 } |
| 71 } | 70 } |
| 72 | 71 |
| 73 </script> | 72 </script> |
| 74 | 73 |
| 75 </head> | 74 </head> |
| 76 | 75 |
| 77 <body onload="runTest()"> | 76 <body onload="runTest()"> |
| 78 <p>Tests the extraction of javascript identifier names from function text.</p> | 77 <p>Tests the extraction of javascript identifier names from function text.</p> |
| 79 | 78 |
| 80 </body> | 79 </body> |
| 81 </html> | 80 </html> |
| OLD | NEW |