| OLD | NEW |
| 1 // Copyright 2017 the V8 project authors. All rights reserved. | 1 // Copyright 2017 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Flags: --ignition --turbo | 5 // Flags: --ignition --turbo |
| 6 let {session, contextGroup, Protocol} = InspectorTest.start('Tests side-effect-f
ree evaluation'); |
| 6 | 7 |
| 7 InspectorTest.addScript(` | 8 contextGroup.addScript(` |
| 8 function testFunction() | 9 function testFunction() |
| 9 { | 10 { |
| 10 var o = 0; | 11 var o = 0; |
| 11 function f() { return 1; } | 12 function f() { return 1; } |
| 12 function g() { o = 2; return o; } | 13 function g() { o = 2; return o; } |
| 13 debugger; | 14 debugger; |
| 14 } | 15 } |
| 15 //# sourceURL=foo.js`); | 16 //# sourceURL=foo.js`); |
| 16 | 17 |
| 17 Protocol.Debugger.enable(); | 18 Protocol.Debugger.enable(); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 47 InspectorTest.log("f() returns " + response.result.result.value); | 48 InspectorTest.log("f() returns " + response.result.result.value); |
| 48 Protocol.Debugger.evaluateOnCallFrame({ callFrameId: topFrameId, expression: "
g()", throwOnSideEffect: true}).then(evaluatedFourth); | 49 Protocol.Debugger.evaluateOnCallFrame({ callFrameId: topFrameId, expression: "
g()", throwOnSideEffect: true}).then(evaluatedFourth); |
| 49 InspectorTest.completeTest(); | 50 InspectorTest.completeTest(); |
| 50 } | 51 } |
| 51 | 52 |
| 52 function evaluatedFourth(response) | 53 function evaluatedFourth(response) |
| 53 { | 54 { |
| 54 InspectorTest.log("g() throws " + response.result.result.className); | 55 InspectorTest.log("g() throws " + response.result.result.className); |
| 55 InspectorTest.completeTest(); | 56 InspectorTest.completeTest(); |
| 56 } | 57 } |
| OLD | NEW |