| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <head> | |
| 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/resource
s/inspector-protocol-test.js"></script> | |
| 4 <script> | |
| 5 | |
| 6 function testFunction() | |
| 7 { | |
| 8 for (var a of [1]) { | |
| 9 ++a; | |
| 10 debugger; | |
| 11 } | |
| 12 } | |
| 13 | |
| 14 function test() | |
| 15 { | |
| 16 InspectorTest.sendCommandOrDie("Debugger.enable", {}); | |
| 17 InspectorTest.eventHandler["Debugger.paused"] = dumpScopeOnPause; | |
| 18 InspectorTest.sendCommandOrDie("Runtime.evaluate", { "expression": "testFunc
tion()" }); | |
| 19 | |
| 20 var waitScopeObjects = 0; | |
| 21 function dumpScopeOnPause(message) | |
| 22 { | |
| 23 var scopeChain = message.params.callFrames[0].scopeChain; | |
| 24 var localScopeObjectIds = []; | |
| 25 for (var scope of scopeChain) { | |
| 26 if (scope.type === "local") | |
| 27 localScopeObjectIds.push(scope.object.objectId); | |
| 28 } | |
| 29 waitScopeObjects = localScopeObjectIds.length; | |
| 30 if (!waitScopeObjects) { | |
| 31 InspectorTest.completeTest(); | |
| 32 } else { | |
| 33 for (var objectId of localScopeObjectIds) | |
| 34 InspectorTest.sendCommandOrDie("Runtime.getProperties", { "objec
tId" : objectId }, dumpProperties); | |
| 35 } | |
| 36 } | |
| 37 | |
| 38 function dumpProperties(message) | |
| 39 { | |
| 40 InspectorTest.logObject(message); | |
| 41 --waitScopeObjects; | |
| 42 if (!waitScopeObjects) | |
| 43 InspectorTest.sendCommandOrDie("Debugger.resume", {}, () => Inspecto
rTest.completeTest()); | |
| 44 } | |
| 45 } | |
| 46 </script> | |
| 47 </head> | |
| 48 <body onLoad="runTest();"> | |
| 49 </body> | |
| 50 </html> | |
| OLD | NEW |