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

Unified Diff: test/mjsunit/debug-evaluate-locals.js

Issue 12953002: Simplify debug evaluate. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/test-heap.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/debug-evaluate-locals.js
diff --git a/test/mjsunit/debug-evaluate-locals.js b/test/mjsunit/debug-evaluate-locals.js
index 61b6dd9bbd6163eee4473330b9c3fd6deec43a95..a68162d9bdcfd71aa42e0d021c0d1259f79d5894 100644
--- a/test/mjsunit/debug-evaluate-locals.js
+++ b/test/mjsunit/debug-evaluate-locals.js
@@ -36,19 +36,20 @@ exception = false;
function h() {
var a = 1;
var b = 2;
+ var eval = 5; // Overriding eval should not break anything.
debugger; // Breakpoint.
}
function checkFrame0(frame) {
// Frame 0 (h) has normal variables a and b.
var count = frame.localCount();
- assertEquals(2, count);
+ assertEquals(3, count);
for (var i = 0; i < count; ++i) {
var name = frame.localName(i);
var value = frame.localValue(i).value();
if (name == 'a') {
assertEquals(1, value);
- } else {
+ } else if (name !='eval') {
assertEquals('b', name);
assertEquals(2, value);
}
@@ -115,16 +116,21 @@ function listener(event, exec_state, event_data, data) {
// Evaluating a and b on frames 0, 1 and 2 produces 1, 2, 3, 4, 5 and 6.
assertEquals(1, exec_state.frame(0).evaluate('a').value());
assertEquals(2, exec_state.frame(0).evaluate('b').value());
+ assertEquals(5, exec_state.frame(0).evaluate('eval').value());
assertEquals(3, exec_state.frame(1).evaluate('a').value());
assertEquals(4, exec_state.frame(1).evaluate('b').value());
+ assertEquals("function",
+ typeof exec_state.frame(1).evaluate('eval').value());
assertEquals(5, exec_state.frame(2).evaluate('a').value());
assertEquals(6, exec_state.frame(2).evaluate('b').value());
-
+ assertEquals("function",
+ typeof exec_state.frame(2).evaluate('eval').value());
// Indicate that all was processed.
listenerComplete = true;
}
} catch (e) {
exception = e
+ print("Caught something. " + e + " " + e.stack);
};
};
@@ -133,6 +139,6 @@ Debug.setListener(listener);
f();
-// Make sure that the debug event listener vas invoked.
-assertTrue(listenerComplete);
+// Make sure that the debug event listener was invoked.
assertFalse(exception, "exception in listener")
+assertTrue(listenerComplete);
« no previous file with comments | « test/cctest/test-heap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698