OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 CHECK(isolate->debug()->Load()); | 102 CHECK(isolate->debug()->Load()); |
103 Handle<v8::internal::Context> debug_context = | 103 Handle<v8::internal::Context> debug_context = |
104 isolate->debug()->debug_context(); | 104 isolate->debug()->debug_context(); |
105 debug_context->set_security_token( | 105 debug_context->set_security_token( |
106 v8::Utils::OpenHandle(*context_)->security_token()); | 106 v8::Utils::OpenHandle(*context_)->security_token()); |
107 | 107 |
108 Handle<JSGlobalProxy> global(Handle<JSGlobalProxy>::cast( | 108 Handle<JSGlobalProxy> global(Handle<JSGlobalProxy>::cast( |
109 v8::Utils::OpenHandle(*context_->Global()))); | 109 v8::Utils::OpenHandle(*context_->Global()))); |
110 Handle<v8::internal::String> debug_string = | 110 Handle<v8::internal::String> debug_string = |
111 factory->InternalizeOneByteString(STATIC_ASCII_VECTOR("debug")); | 111 factory->InternalizeOneByteString(STATIC_ASCII_VECTOR("debug")); |
112 v8::internal::Runtime::SetObjectProperty(isolate, global, debug_string, | 112 v8::internal::Runtime::DefineObjectProperty(global, debug_string, |
113 Handle<Object>(debug_context->global_proxy(), isolate), | 113 handle(debug_context->global_proxy(), isolate), DONT_ENUM).Check(); |
114 DONT_ENUM, | |
115 ::v8::internal::SLOPPY).Check(); | |
116 } | 114 } |
117 | 115 |
118 private: | 116 private: |
119 v8::HandleScope scope_; | 117 v8::HandleScope scope_; |
120 v8::Local<v8::Context> context_; | 118 v8::Local<v8::Context> context_; |
121 }; | 119 }; |
122 | 120 |
123 | 121 |
124 // --- H e l p e r F u n c t i o n s | 122 // --- H e l p e r F u n c t i o n s |
125 | 123 |
(...skipping 7338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7464 TEST(DebugBreakOffThreadTerminate) { | 7462 TEST(DebugBreakOffThreadTerminate) { |
7465 DebugLocalContext env; | 7463 DebugLocalContext env; |
7466 v8::Isolate* isolate = env->GetIsolate(); | 7464 v8::Isolate* isolate = env->GetIsolate(); |
7467 v8::HandleScope scope(isolate); | 7465 v8::HandleScope scope(isolate); |
7468 v8::Debug::SetDebugEventListener(DebugBreakTriggerTerminate); | 7466 v8::Debug::SetDebugEventListener(DebugBreakTriggerTerminate); |
7469 TerminationThread terminator(isolate); | 7467 TerminationThread terminator(isolate); |
7470 terminator.Start(); | 7468 terminator.Start(); |
7471 v8::Debug::DebugBreak(isolate); | 7469 v8::Debug::DebugBreak(isolate); |
7472 CompileRun("while (true);"); | 7470 CompileRun("while (true);"); |
7473 } | 7471 } |
OLD | NEW |