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

Unified Diff: test/cctest/test-debug.cc

Issue 177973002: Lazy preparsing vs. lazy parsing fix. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: . Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-debug.cc
diff --git a/test/cctest/test-debug.cc b/test/cctest/test-debug.cc
index 67ef88516a11fa10ce9d2d0dd2b6f368baf42a67..807797983d3c09af60fb5f9dc674bdbae9bdd2f4 100644
--- a/test/cctest/test-debug.cc
+++ b/test/cctest/test-debug.cc
@@ -7700,4 +7700,39 @@ TEST(LiveEditDisabled) {
}
+TEST(PrecompiledFunction) {
+ // Regression test for crbug.com/346207. If we have preparse data, parsing the
+ // function in the presence of the debugger (and breakpoints) should still
+ // succeed. The bug was that preparsing was done lazily and parsing was done
+ // eagerly, so, the symbol streams didn't match.
+ DebugLocalContext env;
+ v8::HandleScope scope(env->GetIsolate());
+ env.ExposeDebug();
+ v8::Debug::SetDebugEventListener2(DebugBreakInlineListener);
+
+ v8::Local<v8::Function> break_here =
+ CompileFunction(&env, "function break_here(){}", "break_here");
+ SetBreakPoint(break_here, 0);
+
+ const char* source =
+ "var a = b = c = 1; \n"
+ "function this_is_lazy() { \n"
+ // This symbol won't appear in the preparse data.
+ " var a; \n"
+ "} \n"
+ "function bar() { \n"
+ " return \"bar\"; \n"
+ "}; \n"
+ "a = b = c = 2; \n"
+ "bar(); \n";
+ v8::Local<v8::Value> result = PreCompileCompileRun(source);
+ CHECK(result->IsString());
+ v8::String::Utf8Value utf8(result);
+ CHECK_EQ("bar", *utf8);
+
+ v8::Debug::SetDebugEventListener2(NULL);
+ CheckDebuggerUnloaded();
+}
+
+
#endif // ENABLE_DEBUGGER_SUPPORT
« no previous file with comments | « src/compiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698