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

Side by Side Diff: test/debugger/debug/debug-evaluate-no-side-effect-control.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
1 // Copyright 2017 the V8 project authors. All rights reserved. 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 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 // Flags: --ignition --side-effect-free-debug-evaluate 5 // Flags: --ignition
6 6
7 Debug = debug.Debug 7 Debug = debug.Debug
8 8
9 var exception = null; 9 var exception = null;
10 10
11 var o = { p : 1 }; 11 var o = { p : 1 };
12 12
13 var successes = [ 13 var successes = [
14 [45, 14 [45,
15 `(function() { 15 `(function() {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 with (o) { 78 with (o) {
79 p = 2; 79 p = 2;
80 } 80 }
81 })()`, 81 })()`,
82 ]; 82 ];
83 83
84 function listener(event, exec_state, event_data, data) { 84 function listener(event, exec_state, event_data, data) {
85 if (event != Debug.DebugEvent.Break) return; 85 if (event != Debug.DebugEvent.Break) return;
86 try { 86 try {
87 successes.forEach(function ([expectation, source]) { 87 successes.forEach(function ([expectation, source]) {
88 assertEquals(expectation, exec_state.frame(0).evaluate(source).value()); 88 assertEquals(expectation,
89 exec_state.frame(0).evaluate(source, true).value());
89 }); 90 });
90 fails.forEach(function (test) { 91 fails.forEach(function (test) {
91 assertThrows(() => exec_state.frame(0).evaluate(test), EvalError); 92 assertThrows(() => exec_state.frame(0).evaluate(test, true), EvalError);
92 }); 93 });
93 } catch (e) { 94 } catch (e) {
94 exception = e; 95 exception = e;
95 print(e, e.stack); 96 print(e, e.stack);
96 }; 97 };
97 }; 98 };
98 99
99 // Add the debug event listener. 100 // Add the debug event listener.
100 Debug.setListener(listener); 101 Debug.setListener(listener);
101 102
102 function f() { 103 function f() {
103 debugger; 104 debugger;
104 }; 105 };
105 106
106 f(); 107 f();
107 108
108 assertNull(exception); 109 assertNull(exception);
OLDNEW
« no previous file with comments | « test/debugger/debug/debug-evaluate-no-side-effect-builtins.js ('k') | test/debugger/test-api.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698