OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-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 2382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2393 } | 2393 } |
2394 return scope.Close(v8::Utils::ToLocal(Handle<String>::cast(json))); | 2394 return scope.Close(v8::Utils::ToLocal(Handle<String>::cast(json))); |
2395 } else { | 2395 } else { |
2396 return v8::Utils::ToLocal(response_json_); | 2396 return v8::Utils::ToLocal(response_json_); |
2397 } | 2397 } |
2398 } | 2398 } |
2399 | 2399 |
2400 | 2400 |
2401 v8::Handle<v8::Context> MessageImpl::GetEventContext() const { | 2401 v8::Handle<v8::Context> MessageImpl::GetEventContext() const { |
2402 Handle<Context> context = Debug::debugger_entry()->GetContext(); | 2402 Handle<Context> context = Debug::debugger_entry()->GetContext(); |
| 2403 // Top::context() may have been NULL when "script collected" event occured. |
| 2404 if (*context == NULL) { |
| 2405 ASSERT(event_ == v8::ScriptCollected); |
| 2406 return v8::Local<v8::Context>(); |
| 2407 } |
2403 Handle<Context> global_context(context->global_context()); | 2408 Handle<Context> global_context(context->global_context()); |
2404 return v8::Utils::ToLocal(global_context); | 2409 return v8::Utils::ToLocal(global_context); |
2405 } | 2410 } |
2406 | 2411 |
2407 | 2412 |
2408 v8::Debug::ClientData* MessageImpl::GetClientData() const { | 2413 v8::Debug::ClientData* MessageImpl::GetClientData() const { |
2409 return client_data_; | 2414 return client_data_; |
2410 } | 2415 } |
2411 | 2416 |
2412 | 2417 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2518 | 2523 |
2519 | 2524 |
2520 void LockingCommandMessageQueue::Clear() { | 2525 void LockingCommandMessageQueue::Clear() { |
2521 ScopedLock sl(lock_); | 2526 ScopedLock sl(lock_); |
2522 queue_.Clear(); | 2527 queue_.Clear(); |
2523 } | 2528 } |
2524 | 2529 |
2525 #endif // ENABLE_DEBUGGER_SUPPORT | 2530 #endif // ENABLE_DEBUGGER_SUPPORT |
2526 | 2531 |
2527 } } // namespace v8::internal | 2532 } } // namespace v8::internal |
OLD | NEW |