Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(298)

Side by Side Diff: test/inspector/debugger/side-effect-free-debug-evaluate.js

Issue 2685483002: [debugger] expose side-effect free evaluate to inspector. (Closed)
Patch Set: add inspector test Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 // Flags: --ignition
6
7 InspectorTest.addScript(`
8 function testFunction()
9 {
10 var o = 0;
11 function f() { return 1; }
12 function g() { o = 2; return o; }
13 debugger;
14 }
15 //# sourceURL=foo.js`);
16
17 Protocol.Debugger.enable();
18
19 Protocol.Debugger.oncePaused().then(debuggerPaused);
20
21 Protocol.Runtime.evaluate({ "expression": "setTimeout(testFunction, 0)" });
22
23 var topFrameId;
24
25 function debuggerPaused(messageObject)
26 {
27 InspectorTest.log("Paused on 'debugger;'");
28
29 topFrameId = messageObject.params.callFrames[0].callFrameId;
30 Protocol.Debugger.evaluateOnCallFrame({ callFrameId: topFrameId, expression: " f()"}).then(evaluatedFirst);
31 }
32
33 function evaluatedFirst(response)
34 {
35 InspectorTest.log("f() returns " + response.result.result.value);
36 Protocol.Debugger.evaluateOnCallFrame({ callFrameId: topFrameId, expression: " g()"}).then(evaluatedSecond);
37 }
38
39 function evaluatedSecond(response)
40 {
41 InspectorTest.log("g() returns " + response.result.result.value);
42 Protocol.Debugger.evaluateOnCallFrame({ callFrameId: topFrameId, expression: " f()", throwOnSideEffect: true}).then(evaluatedThird);
43 }
44
45 function evaluatedThird(response)
46 {
47 InspectorTest.log("f() returns " + response.result.result.value);
48 Protocol.Debugger.evaluateOnCallFrame({ callFrameId: topFrameId, expression: " g()", throwOnSideEffect: true}).then(evaluatedFourth);
49 InspectorTest.completeTest();
50 }
51
52 function evaluatedFourth(response)
53 {
54 InspectorTest.log("g() throws " + response.result.result.className);
55 InspectorTest.completeTest();
56 }
OLDNEW
« no previous file with comments | « test/debugger/test-api.js ('k') | test/inspector/debugger/side-effect-free-debug-evaluate-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698