OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 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 | 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 InspectorTest.addScript( | 5 let {session, contextGroup, Protocol} = InspectorTest.start('Tests that blackbox
ed ranges are respected while stepping'); |
| 6 |
| 7 contextGroup.addScript( |
6 `function blackboxedBoo() | 8 `function blackboxedBoo() |
7 { | 9 { |
8 var a = 42; | 10 var a = 42; |
9 var b = foo(); | 11 var b = foo(); |
10 return a + b; | 12 return a + b; |
11 } | 13 } |
12 //# sourceURL=blackboxed-script.js`); | 14 //# sourceURL=blackboxed-script.js`); |
13 | 15 |
14 InspectorTest.addScript( | 16 contextGroup.addScript( |
15 `function notBlackboxedFoo() | 17 `function notBlackboxedFoo() |
16 { | 18 { |
17 var a = 42; | 19 var a = 42; |
18 var b = blackboxedBoo(); | 20 var b = blackboxedBoo(); |
19 return a + b; | 21 return a + b; |
20 } | 22 } |
21 | 23 |
22 function blackboxedFoo() | 24 function blackboxedFoo() |
23 { | 25 { |
24 var a = 42; | 26 var a = 42; |
25 var b = notBlackboxedFoo(); | 27 var b = notBlackboxedFoo(); |
26 return a + b; | 28 return a + b; |
27 } | 29 } |
28 | 30 |
29 function notBlackboxedBoo() | 31 function notBlackboxedBoo() |
30 { | 32 { |
31 var a = 42; | 33 var a = 42; |
32 var b = blackboxedFoo(); | 34 var b = blackboxedFoo(); |
33 return a + b; | 35 return a + b; |
34 } | 36 } |
35 //# sourceURL=mixed-source.js`); | 37 //# sourceURL=mixed-source.js`); |
36 | 38 |
37 InspectorTest.addScript( | 39 contextGroup.addScript( |
38 `function testFunction() | 40 `function testFunction() |
39 { | 41 { |
40 notBlackboxedBoo(); // for setup ranges and stepOut | 42 notBlackboxedBoo(); // for setup ranges and stepOut |
41 notBlackboxedBoo(); // for stepIn | 43 notBlackboxedBoo(); // for stepIn |
42 } | 44 } |
43 | 45 |
44 function foo() | 46 function foo() |
45 { | 47 { |
46 debugger; | 48 debugger; |
47 return 239; | 49 return 239; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 | 126 |
125 function printCallFrames(callFrames) | 127 function printCallFrames(callFrames) |
126 { | 128 { |
127 var topCallFrame = callFrames[0]; | 129 var topCallFrame = callFrames[0]; |
128 if (topCallFrame.functionName.startsWith("blackboxed")) | 130 if (topCallFrame.functionName.startsWith("blackboxed")) |
129 InspectorTest.log("FAIL: blackboxed function in top call frame"); | 131 InspectorTest.log("FAIL: blackboxed function in top call frame"); |
130 for (var callFrame of callFrames) | 132 for (var callFrame of callFrames) |
131 InspectorTest.log(callFrame.functionName + ": " + callFrame.location.lineNum
ber + ":" + callFrame.location.columnNumber); | 133 InspectorTest.log(callFrame.functionName + ": " + callFrame.location.lineNum
ber + ":" + callFrame.location.columnNumber); |
132 InspectorTest.log(""); | 134 InspectorTest.log(""); |
133 } | 135 } |
OLD | NEW |