| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 2156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2167 int sbp2 = SetScriptBreakPointByNameFromJS("test.html", 1, -1); | 2167 int sbp2 = SetScriptBreakPointByNameFromJS("test.html", 1, -1); |
| 2168 int sbp3 = SetScriptBreakPointByNameFromJS("test.html", 5, -1); | 2168 int sbp3 = SetScriptBreakPointByNameFromJS("test.html", 5, -1); |
| 2169 | 2169 |
| 2170 // Compile the script and get the function. | 2170 // Compile the script and get the function. |
| 2171 break_point_hit_count = 0; | 2171 break_point_hit_count = 0; |
| 2172 v8::ScriptOrigin origin(v8::String::New("test.html"), v8::Integer::New(0)); | 2172 v8::ScriptOrigin origin(v8::String::New("test.html"), v8::Integer::New(0)); |
| 2173 v8::Script::Compile(script, &origin)->Run(); | 2173 v8::Script::Compile(script, &origin)->Run(); |
| 2174 f = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f"))); | 2174 f = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f"))); |
| 2175 g = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("g"))); | 2175 g = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("g"))); |
| 2176 | 2176 |
| 2177 // Chesk that a break point was hit when the script was run. | 2177 // Check that a break point was hit when the script was run. |
| 2178 CHECK_EQ(1, break_point_hit_count); | 2178 CHECK_EQ(1, break_point_hit_count); |
| 2179 CHECK_EQ(0, StrLength(last_function_hit)); | 2179 CHECK_EQ(0, StrLength(last_function_hit)); |
| 2180 | 2180 |
| 2181 // Call f and check that the script break point. | 2181 // Call f and check that the script break point. |
| 2182 f->Call(env->Global(), 0, NULL); | 2182 f->Call(env->Global(), 0, NULL); |
| 2183 CHECK_EQ(2, break_point_hit_count); | 2183 CHECK_EQ(2, break_point_hit_count); |
| 2184 CHECK_EQ("f", last_function_hit); | 2184 CHECK_EQ("f", last_function_hit); |
| 2185 | 2185 |
| 2186 // Call g and check that the script break point. | 2186 // Call g and check that the script break point. |
| 2187 g->Call(env->Global(), 0, NULL); | 2187 g->Call(env->Global(), 0, NULL); |
| (...skipping 5106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7294 TestDebugBreakInLoop("for (;;) {", loop_bodies, "}"); | 7294 TestDebugBreakInLoop("for (;;) {", loop_bodies, "}"); |
| 7295 TestDebugBreakInLoop("for (;a == 1;) {", loop_bodies, "}"); | 7295 TestDebugBreakInLoop("for (;a == 1;) {", loop_bodies, "}"); |
| 7296 | 7296 |
| 7297 // Get rid of the debug event listener. | 7297 // Get rid of the debug event listener. |
| 7298 v8::Debug::SetDebugEventListener(NULL); | 7298 v8::Debug::SetDebugEventListener(NULL); |
| 7299 CheckDebuggerUnloaded(); | 7299 CheckDebuggerUnloaded(); |
| 7300 } | 7300 } |
| 7301 | 7301 |
| 7302 | 7302 |
| 7303 #endif // ENABLE_DEBUGGER_SUPPORT | 7303 #endif // ENABLE_DEBUGGER_SUPPORT |
| OLD | NEW |