OLD | NEW |
1 // Copyright 2007-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2008 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 5421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5432 // Call f then g. The debugger statement in f will casue a break which will | 5432 // Call f then g. The debugger statement in f will casue a break which will |
5433 // cause another break. | 5433 // cause another break. |
5434 f->Call(env->Global(), 0, NULL); | 5434 f->Call(env->Global(), 0, NULL); |
5435 CHECK_EQ(2, message_handler_break_hit_count); | 5435 CHECK_EQ(2, message_handler_break_hit_count); |
5436 // Calling g will not cause any additional breaks. | 5436 // Calling g will not cause any additional breaks. |
5437 g->Call(env->Global(), 0, NULL); | 5437 g->Call(env->Global(), 0, NULL); |
5438 CHECK_EQ(2, message_handler_break_hit_count); | 5438 CHECK_EQ(2, message_handler_break_hit_count); |
5439 } | 5439 } |
5440 | 5440 |
5441 | 5441 |
5442 #ifdef V8_NATIVE_REGEXP | 5442 #ifndef V8_INTERPRETED_REGEXP |
5443 // Debug event handler which gets the function on the top frame and schedules a | 5443 // Debug event handler which gets the function on the top frame and schedules a |
5444 // break a number of times. | 5444 // break a number of times. |
5445 static void DebugEventDebugBreak( | 5445 static void DebugEventDebugBreak( |
5446 v8::DebugEvent event, | 5446 v8::DebugEvent event, |
5447 v8::Handle<v8::Object> exec_state, | 5447 v8::Handle<v8::Object> exec_state, |
5448 v8::Handle<v8::Object> event_data, | 5448 v8::Handle<v8::Object> event_data, |
5449 v8::Handle<v8::Value> data) { | 5449 v8::Handle<v8::Value> data) { |
5450 | 5450 |
5451 if (event == v8::Break) { | 5451 if (event == v8::Break) { |
5452 break_point_hit_count++; | 5452 break_point_hit_count++; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5499 | 5499 |
5500 v8::Debug::SetDebugEventListener(DebugEventDebugBreak); | 5500 v8::Debug::SetDebugEventListener(DebugEventDebugBreak); |
5501 v8::Debug::DebugBreak(); | 5501 v8::Debug::DebugBreak(); |
5502 result = f->Call(env->Global(), argc, argv); | 5502 result = f->Call(env->Global(), argc, argv); |
5503 | 5503 |
5504 // Check that there was only one break event. Matching RegExp should not | 5504 // Check that there was only one break event. Matching RegExp should not |
5505 // cause Break events. | 5505 // cause Break events. |
5506 CHECK_EQ(1, break_point_hit_count); | 5506 CHECK_EQ(1, break_point_hit_count); |
5507 CHECK_EQ("f", last_function_hit); | 5507 CHECK_EQ("f", last_function_hit); |
5508 } | 5508 } |
5509 #endif // V8_NATIVE_REGEXP | 5509 #endif // V8_INTERPRETED_REGEXP |
5510 | 5510 |
5511 | 5511 |
5512 // Common part of EvalContextData and NestedBreakEventContextData tests. | 5512 // Common part of EvalContextData and NestedBreakEventContextData tests. |
5513 static void ExecuteScriptForContextCheck() { | 5513 static void ExecuteScriptForContextCheck() { |
5514 // Create a context. | 5514 // Create a context. |
5515 v8::Persistent<v8::Context> context_1; | 5515 v8::Persistent<v8::Context> context_1; |
5516 v8::Handle<v8::ObjectTemplate> global_template = | 5516 v8::Handle<v8::ObjectTemplate> global_template = |
5517 v8::Handle<v8::ObjectTemplate>(); | 5517 v8::Handle<v8::ObjectTemplate>(); |
5518 v8::Handle<v8::Value> global_object = v8::Handle<v8::Value>(); | 5518 v8::Handle<v8::Value> global_object = v8::Handle<v8::Value>(); |
5519 context_1 = v8::Context::New(NULL, global_template, global_object); | 5519 context_1 = v8::Context::New(NULL, global_template, global_object); |
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6132 | 6132 |
6133 break_point_hit_count = 0; | 6133 break_point_hit_count = 0; |
6134 foo->Call(env->Global(), 0, NULL); | 6134 foo->Call(env->Global(), 0, NULL); |
6135 CHECK_EQ(1, break_point_hit_count); | 6135 CHECK_EQ(1, break_point_hit_count); |
6136 | 6136 |
6137 v8::Debug::SetDebugEventListener(NULL); | 6137 v8::Debug::SetDebugEventListener(NULL); |
6138 debugee_context = v8::Handle<v8::Context>(); | 6138 debugee_context = v8::Handle<v8::Context>(); |
6139 debugger_context = v8::Handle<v8::Context>(); | 6139 debugger_context = v8::Handle<v8::Context>(); |
6140 CheckDebuggerUnloaded(); | 6140 CheckDebuggerUnloaded(); |
6141 } | 6141 } |
OLD | NEW |