| 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 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 | 813 |
| 814 // Create the debugger context. | 814 // Create the debugger context. |
| 815 HandleScope scope(isolate_); | 815 HandleScope scope(isolate_); |
| 816 Handle<Context> context = | 816 Handle<Context> context = |
| 817 isolate_->bootstrapper()->CreateEnvironment( | 817 isolate_->bootstrapper()->CreateEnvironment( |
| 818 isolate_, | 818 isolate_, |
| 819 Handle<Object>::null(), | 819 Handle<Object>::null(), |
| 820 v8::Handle<ObjectTemplate>(), | 820 v8::Handle<ObjectTemplate>(), |
| 821 NULL); | 821 NULL); |
| 822 | 822 |
| 823 // Fail if no context could be created. |
| 824 if (context.is_null()) return false; |
| 825 |
| 823 // Use the debugger context. | 826 // Use the debugger context. |
| 824 SaveContext save(isolate_); | 827 SaveContext save(isolate_); |
| 825 isolate_->set_context(*context); | 828 isolate_->set_context(*context); |
| 826 | 829 |
| 827 // Expose the builtins object in the debugger context. | 830 // Expose the builtins object in the debugger context. |
| 828 Handle<String> key = isolate_->factory()->LookupAsciiSymbol("builtins"); | 831 Handle<String> key = isolate_->factory()->LookupAsciiSymbol("builtins"); |
| 829 Handle<GlobalObject> global = Handle<GlobalObject>(context->global()); | 832 Handle<GlobalObject> global = Handle<GlobalObject>(context->global()); |
| 830 RETURN_IF_EMPTY_HANDLE_VALUE( | 833 RETURN_IF_EMPTY_HANDLE_VALUE( |
| 831 isolate_, | 834 isolate_, |
| 832 JSReceiver::SetProperty(global, key, Handle<Object>(global->builtins()), | 835 JSReceiver::SetProperty(global, key, Handle<Object>(global->builtins()), |
| (...skipping 2746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3579 { | 3582 { |
| 3580 Locker locker; | 3583 Locker locker; |
| 3581 Isolate::Current()->debugger()->CallMessageDispatchHandler(); | 3584 Isolate::Current()->debugger()->CallMessageDispatchHandler(); |
| 3582 } | 3585 } |
| 3583 } | 3586 } |
| 3584 } | 3587 } |
| 3585 | 3588 |
| 3586 #endif // ENABLE_DEBUGGER_SUPPORT | 3589 #endif // ENABLE_DEBUGGER_SUPPORT |
| 3587 | 3590 |
| 3588 } } // namespace v8::internal | 3591 } } // namespace v8::internal |
| OLD | NEW |