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 print("Check that debug and monitor methods from Command Line API works with bou
nd function."); |
| 6 |
| 7 InspectorTest.addScript(` |
| 8 function foo() {} |
| 9 function boo() {} |
| 10 var bar = boo.bind(null); |
| 11 |
| 12 function testFunction() { |
| 13 debug(foo); |
| 14 debug(bar); |
| 15 foo(); |
| 16 bar(); |
| 17 undebug(foo); |
| 18 undebug(bar); |
| 19 foo(); |
| 20 bar(); |
| 21 |
| 22 monitor(foo); |
| 23 monitor(bar); |
| 24 foo(); |
| 25 bar(); |
| 26 unmonitor(foo); |
| 27 unmonitor(bar); |
| 28 foo(); |
| 29 bar(); |
| 30 |
| 31 monitor(bar); |
| 32 debug(bar); |
| 33 bar(); |
| 34 undebug(bar); |
| 35 bar(); |
| 36 debug(bar); |
| 37 unmonitor(bar); |
| 38 bar(); |
| 39 }`); |
| 40 |
| 41 Protocol.Runtime.enable(); |
| 42 Protocol.Debugger.enable(); |
| 43 Protocol.Debugger.onPaused(message => { |
| 44 var functionName = message.params.callFrames[0].functionName; |
| 45 InspectorTest.log(`paused in ${functionName}`); |
| 46 Protocol.Debugger.resume(); |
| 47 }); |
| 48 Protocol.Runtime.onConsoleAPICalled(message => InspectorTest.log(message.params.
args[0].value)); |
| 49 Protocol.Runtime.evaluate({ expression: "testFunction()", includeCommandLineAPI:
true }) |
| 50 .then(InspectorTest.completeTest); |
OLD | NEW |