Revision: 7633
Author: [email protected]
Date: Fri Apr 15 07:09:45 2011
Log: Fix debuger evaluation on a breakpoint inside eval
Corresponding Chromium issue:
http://code.google.com/p/chromium/issues/detail?id=74412
Review URL: http://codereview.chromium.org/6875005
http://code.google.com/p/v8/source/detail?r=7633
Modified:
/branches/bleeding_edge/src/runtime.cc
/branches/bleeding_edge/test/mjsunit/debug-evaluate-with.js
=======================================
--- /branches/bleeding_edge/src/runtime.cc Wed Apr 13 02:35:56 2011
+++ /branches/bleeding_edge/src/runtime.cc Fri Apr 15 07:09:45 2011
@@ -10485,7 +10485,7 @@
// Recursively copy the with contexts.
Handle<Context> previous(context_chain->previous());
Handle<JSObject> extension(JSObject::cast(context_chain->extension()));
- Handle<Context> context = CopyWithContextChain(function_context,
previous);
+ Handle<Context> context = CopyWithContextChain(previous,
function_context);
return context->GetIsolate()->factory()->NewWithContext(
context, extension, context_chain->IsCatchContext());
}
=======================================
--- /branches/bleeding_edge/test/mjsunit/debug-evaluate-with.js Tue Dec 7
03:01:02 2010
+++ /branches/bleeding_edge/test/mjsunit/debug-evaluate-with.js Fri Apr 15
07:09:45 2011
@@ -42,13 +42,13 @@
// Break point in first with block.
assertEquals(2, exec_state.frame(0).evaluate('a').value());
assertEquals(2, exec_state.frame(0).evaluate('b').value());
- } else {
+ } else if (breakPointCount == 2) {
// Break point in second with block.
assertEquals(3, exec_state.frame(0).evaluate('a').value());
assertEquals(1, exec_state.frame(0).evaluate('b').value());
-
- // Indicate that all was processed.
- listenerComplete = true;
+ } else if (breakPointCount == 3) {
+ // Break point in eval with block.
+ assertEquals('local', exec_state.frame(0).evaluate('foo').value());
}
}
} catch (e) {
@@ -72,6 +72,10 @@
};
f();
+
+var foo = "global";
+eval("with({bar:'with'}) { (function g() { var foo = 'local'; debugger;
})(); }");
+
// Make sure that the debug event listener vas invoked.
-assertTrue(listenerComplete);
+assertEquals(3, breakPointCount);
assertFalse(exception, "exception in listener")
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev