summaryrefslogtreecommitdiff
path: root/deps/v8/test/cctest/test-debug.cc
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2010-07-07 19:47:38 +0200
committerRyan Dahl <ry@tinyclouds.org>2010-07-07 19:47:38 +0200
commitfacb904c5db23345a693bf3aa02b1497af12fddd (patch)
tree57de363b1a8e39b25d3e020a88f87f832f1f2aa5 /deps/v8/test/cctest/test-debug.cc
parent70a8fb3763c92337bbc6a6138dd0c320134b847c (diff)
downloadnode-new-facb904c5db23345a693bf3aa02b1497af12fddd.tar.gz
Upgrade V8 to 2.2.23
Diffstat (limited to 'deps/v8/test/cctest/test-debug.cc')
-rw-r--r--deps/v8/test/cctest/test-debug.cc35
1 files changed, 34 insertions, 1 deletions
diff --git a/deps/v8/test/cctest/test-debug.cc b/deps/v8/test/cctest/test-debug.cc
index e689637865..8ebf7522a6 100644
--- a/deps/v8/test/cctest/test-debug.cc
+++ b/deps/v8/test/cctest/test-debug.cc
@@ -2075,6 +2075,39 @@ TEST(ScriptBreakPointLineTopLevel) {
}
+// Test that it is possible to add and remove break points in a top level
+// function which has no references but has not been collected yet.
+TEST(ScriptBreakPointTopLevelCrash) {
+ v8::HandleScope scope;
+ DebugLocalContext env;
+ env.ExposeDebug();
+
+ v8::Debug::SetDebugEventListener(DebugEventBreakPointHitCount,
+ v8::Undefined());
+
+ v8::Local<v8::String> script_source = v8::String::New(
+ "function f() {\n"
+ " return 0;\n"
+ "}\n"
+ "f()");
+
+ int sbp1 = SetScriptBreakPointByNameFromJS("test.html", 3, -1);
+ {
+ v8::HandleScope scope;
+ break_point_hit_count = 0;
+ v8::Script::Compile(script_source, v8::String::New("test.html"))->Run();
+ CHECK_EQ(1, break_point_hit_count);
+ }
+
+ int sbp2 = SetScriptBreakPointByNameFromJS("test.html", 3, -1);
+ ClearBreakPointFromJS(sbp1);
+ ClearBreakPointFromJS(sbp2);
+
+ v8::Debug::SetDebugEventListener(NULL);
+ CheckDebuggerUnloaded();
+}
+
+
// Test that it is possible to remove the last break point for a function
// inside the break handling of that break point.
TEST(RemoveBreakPointInBreak) {
@@ -2129,7 +2162,7 @@ TEST(DebuggerStatement) {
}
-// Test setting a breakpoint on the debugger statement.
+// Test setting a breakpoint on the debugger statement.
TEST(DebuggerStatementBreakpoint) {
break_point_hit_count = 0;
v8::HandleScope scope;