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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 v8::FunctionTemplate::New(ReadLine)); | 205 v8::FunctionTemplate::New(ReadLine)); |
206 } | 206 } |
207 | 207 |
208 // Create a new execution environment containing the built-in | 208 // Create a new execution environment containing the built-in |
209 // functions | 209 // functions |
210 v8::Handle<v8::Context> context = v8::Context::New(NULL, global); | 210 v8::Handle<v8::Context> context = v8::Context::New(NULL, global); |
211 // Enter the newly created execution environment. | 211 // Enter the newly created execution environment. |
212 v8::Context::Scope context_scope(context); | 212 v8::Context::Scope context_scope(context); |
213 | 213 |
214 #ifdef ENABLE_DEBUGGER_SUPPORT | 214 #ifdef ENABLE_DEBUGGER_SUPPORT |
215 debug_message_context = v8::Persistent<v8::Context>::New(context); | 215 debug_message_context = |
| 216 v8::Persistent<v8::Context>::New(context->GetIsolate(), context); |
216 | 217 |
217 v8::Locker locker(v8::Isolate::GetCurrent()); | 218 v8::Locker locker(context->GetIsolate()); |
218 | 219 |
219 if (support_callback) { | 220 if (support_callback) { |
220 v8::Debug::SetDebugMessageDispatchHandler(DispatchDebugMessages, true); | 221 v8::Debug::SetDebugMessageDispatchHandler(DispatchDebugMessages, true); |
221 } | 222 } |
222 | 223 |
223 if (port_number != -1) { | 224 if (port_number != -1) { |
224 v8::Debug::EnableAgent("lineprocessor", port_number, wait_for_connection); | 225 v8::Debug::EnableAgent("lineprocessor", port_number, wait_for_connection); |
225 } | 226 } |
226 #endif // ENABLE_DEBUGGER_SUPPORT | 227 #endif // ENABLE_DEBUGGER_SUPPORT |
227 | 228 |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 } | 431 } |
431 // Remove newline char | 432 // Remove newline char |
432 for (char* pos = buffer; *pos != '\0'; pos++) { | 433 for (char* pos = buffer; *pos != '\0'; pos++) { |
433 if (*pos == '\n') { | 434 if (*pos == '\n') { |
434 *pos = '\0'; | 435 *pos = '\0'; |
435 break; | 436 break; |
436 } | 437 } |
437 } | 438 } |
438 return v8::String::New(buffer); | 439 return v8::String::New(buffer); |
439 } | 440 } |
OLD | NEW |