| OLD | NEW | 
|---|
|  | (Empty) | 
| 1 // Copyright 2016 the V8 project authors. All rights reserved. |  | 
| 2 // Use of this source code is governed by a BSD-style license that can be |  | 
| 3 // found in the LICENSE file. |  | 
| 4 |  | 
| 5 InspectorTest.evaluateInPage( |  | 
| 6 `function TestFunction() |  | 
| 7 { |  | 
| 8     var a = 2; |  | 
| 9     debugger; |  | 
| 10     debugger; |  | 
| 11 }`); |  | 
| 12 |  | 
| 13 var newVariableValue = 55; |  | 
| 14 |  | 
| 15 InspectorTest.sendCommand("Debugger.enable", {}); |  | 
| 16 |  | 
| 17 InspectorTest.eventHandler["Debugger.paused"] = handleDebuggerPaused; |  | 
| 18 |  | 
| 19 InspectorTest.sendCommand("Runtime.evaluate", { "expression": "setTimeout(TestFu
    nction, 0)" }); |  | 
| 20 |  | 
| 21 function handleDebuggerPaused(messageObject) |  | 
| 22 { |  | 
| 23   InspectorTest.log("Paused on 'debugger;'"); |  | 
| 24   InspectorTest.eventHandler["Debugger.paused"] = undefined; |  | 
| 25 |  | 
| 26   var topFrame = messageObject.params.callFrames[0]; |  | 
| 27   var topFrameId = topFrame.callFrameId; |  | 
| 28   InspectorTest.sendCommand("Debugger.evaluateOnCallFrame", { "callFrameId": top
    FrameId, "expression": "a = " + newVariableValue }, callbackChangeValue); |  | 
| 29 } |  | 
| 30 |  | 
| 31 function callbackChangeValue(response) |  | 
| 32 { |  | 
| 33   InspectorTest.log("Variable value changed"); |  | 
| 34   InspectorTest.eventHandler["Debugger.paused"] = callbackGetBacktrace; |  | 
| 35   InspectorTest.sendCommand("Debugger.resume", { }); |  | 
| 36 } |  | 
| 37 |  | 
| 38 function callbackGetBacktrace(response) |  | 
| 39 { |  | 
| 40   InspectorTest.log("Stacktrace re-read again"); |  | 
| 41   var localScope = response.params.callFrames[0].scopeChain[0]; |  | 
| 42   InspectorTest.sendCommand("Runtime.getProperties", { "objectId": localScope.ob
    ject.objectId }, callbackGetProperties); |  | 
| 43 } |  | 
| 44 |  | 
| 45 function callbackGetProperties(response) |  | 
| 46 { |  | 
| 47   InspectorTest.log("Scope variables downloaded anew"); |  | 
| 48   var varNamedA; |  | 
| 49   var propertyList = response.result.result; |  | 
| 50   for (var i = 0; i < propertyList.length; i++) { |  | 
| 51     if (propertyList[i].name === "a") { |  | 
| 52       varNamedA = propertyList[i]; |  | 
| 53       break; |  | 
| 54     } |  | 
| 55   } |  | 
| 56   if (varNamedA) { |  | 
| 57     var actualValue = varNamedA.value.value; |  | 
| 58     InspectorTest.log("New variable is " + actualValue + ", expected is " + newV
    ariableValue + ", old was: 2"); |  | 
| 59     InspectorTest.log(actualValue === newVariableValue ? "SUCCESS" : "FAIL"); |  | 
| 60   } else { |  | 
| 61     InspectorTest.log("Failed to find variable in scope"); |  | 
| 62   } |  | 
| 63   InspectorTest.completeTest(); |  | 
| 64 } |  | 
| OLD | NEW | 
|---|