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); |