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.sendCommand("Runtime.evaluate", { expression: "let a = 42;" }, ste
p2); |
| 6 |
| 7 function step2(response) |
| 8 { |
| 9 failIfError(response); |
| 10 InspectorTest.log("first \"let a = 1;\" result: wasThrown = " + !!response.res
ult.exceptionDetails); |
| 11 InspectorTest.sendCommand("Runtime.evaluate", { expression: "let a = 239;" },
step3); |
| 12 } |
| 13 |
| 14 function step3(response) |
| 15 { |
| 16 failIfError(response); |
| 17 InspectorTest.log("second \"let a = 1;\" result: wasThrown = " + !!response.re
sult.exceptionDetails); |
| 18 if (response.result.exceptionDetails) |
| 19 InspectorTest.log("exception message: " + response.result.exceptionDetails.t
ext + " " + response.result.exceptionDetails.exception.description); |
| 20 InspectorTest.sendCommand("Runtime.evaluate", { expression: "a" }, step4); |
| 21 } |
| 22 |
| 23 function step4(response) |
| 24 { |
| 25 failIfError(response); |
| 26 InspectorTest.log(JSON.stringify(response.result)); |
| 27 checkMethod(null); |
| 28 } |
| 29 |
| 30 var methods = [ "dir", "dirxml", "keys", "values", "profile", "profileEnd", |
| 31 "inspect", "copy", "clear", |
| 32 "debug", "undebug", "monitor", "unmonitor", "table" ]; |
| 33 |
| 34 function checkMethod(response) |
| 35 { |
| 36 failIfError(response); |
| 37 |
| 38 if (response) |
| 39 InspectorTest.log(response.result.result.description); |
| 40 |
| 41 var method = methods.shift(); |
| 42 if (!method) |
| 43 InspectorTest.completeTest(); |
| 44 |
| 45 InspectorTest.sendCommand("Runtime.evaluate", { expression: method, includeCom
mandLineAPI: true }, checkMethod); |
| 46 } |
| 47 |
| 48 function failIfError(response) |
| 49 { |
| 50 if (response && response.error) |
| 51 InspectorTest.log("FAIL: " + JSON.stringify(response.error)); |
| 52 } |
OLD | NEW |