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 let {session, contextGroup, Protocol} = InspectorTest.start('Tests how let and c
onst interact with command line api'); |
| 6 |
5 Protocol.Runtime.evaluate({ expression: "let a = 42;" }).then(step2); | 7 Protocol.Runtime.evaluate({ expression: "let a = 42;" }).then(step2); |
6 | 8 |
7 function step2(response) | 9 function step2(response) |
8 { | 10 { |
9 failIfError(response); | 11 failIfError(response); |
10 InspectorTest.log("first \"let a = 1;\" result: wasThrown = " + !!response.res
ult.exceptionDetails); | 12 InspectorTest.log("first \"let a = 1;\" result: wasThrown = " + !!response.res
ult.exceptionDetails); |
11 Protocol.Runtime.evaluate({ expression: "let a = 239;" }).then(step3); | 13 Protocol.Runtime.evaluate({ expression: "let a = 239;" }).then(step3); |
12 } | 14 } |
13 | 15 |
14 function step3(response) | 16 function step3(response) |
(...skipping 28 matching lines...) Expand all Loading... |
43 InspectorTest.completeTest(); | 45 InspectorTest.completeTest(); |
44 | 46 |
45 Protocol.Runtime.evaluate({ expression: method, includeCommandLineAPI: true })
.then(checkMethod); | 47 Protocol.Runtime.evaluate({ expression: method, includeCommandLineAPI: true })
.then(checkMethod); |
46 } | 48 } |
47 | 49 |
48 function failIfError(response) | 50 function failIfError(response) |
49 { | 51 { |
50 if (response && response.error) | 52 if (response && response.error) |
51 InspectorTest.log("FAIL: " + JSON.stringify(response.error)); | 53 InspectorTest.log("FAIL: " + JSON.stringify(response.error)); |
52 } | 54 } |
OLD | NEW |