OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/api.h" | 5 #include "src/api.h" |
6 | 6 |
7 #include <string.h> // For memcpy, strlen. | 7 #include <string.h> // For memcpy, strlen. |
8 #ifdef V8_USE_ADDRESS_SANITIZER | 8 #ifdef V8_USE_ADDRESS_SANITIZER |
9 #include <sanitizer/asan_interface.h> | 9 #include <sanitizer/asan_interface.h> |
10 #endif // V8_USE_ADDRESS_SANITIZER | 10 #endif // V8_USE_ADDRESS_SANITIZER |
(...skipping 5566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5577 v8::ExtensionConfiguration* extensions, | 5577 v8::ExtensionConfiguration* extensions, |
5578 v8::Handle<ObjectTemplate> global_template, | 5578 v8::Handle<ObjectTemplate> global_template, |
5579 v8::Handle<Value> global_object) { | 5579 v8::Handle<Value> global_object) { |
5580 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(external_isolate); | 5580 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(external_isolate); |
5581 LOG_API(isolate, "Context::New"); | 5581 LOG_API(isolate, "Context::New"); |
5582 i::HandleScope scope(isolate); | 5582 i::HandleScope scope(isolate); |
5583 ExtensionConfiguration no_extensions; | 5583 ExtensionConfiguration no_extensions; |
5584 if (extensions == NULL) extensions = &no_extensions; | 5584 if (extensions == NULL) extensions = &no_extensions; |
5585 i::Handle<i::Context> env = | 5585 i::Handle<i::Context> env = |
5586 CreateEnvironment(isolate, extensions, global_template, global_object); | 5586 CreateEnvironment(isolate, extensions, global_template, global_object); |
5587 if (env.is_null()) return Local<Context>(); | 5587 if (env.is_null()) { |
| 5588 if (isolate->has_pending_exception()) { |
| 5589 isolate->OptionalRescheduleException(true); |
| 5590 } |
| 5591 return Local<Context>(); |
| 5592 } |
5588 return Utils::ToLocal(scope.CloseAndEscape(env)); | 5593 return Utils::ToLocal(scope.CloseAndEscape(env)); |
5589 } | 5594 } |
5590 | 5595 |
5591 | 5596 |
5592 void v8::Context::SetSecurityToken(Handle<Value> token) { | 5597 void v8::Context::SetSecurityToken(Handle<Value> token) { |
5593 i::Handle<i::Context> env = Utils::OpenHandle(this); | 5598 i::Handle<i::Context> env = Utils::OpenHandle(this); |
5594 i::Handle<i::Object> token_handle = Utils::OpenHandle(*token); | 5599 i::Handle<i::Object> token_handle = Utils::OpenHandle(*token); |
5595 env->set_security_token(*token_handle); | 5600 env->set_security_token(*token_handle); |
5596 } | 5601 } |
5597 | 5602 |
(...skipping 2798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8396 Address callback_address = | 8401 Address callback_address = |
8397 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8402 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
8398 VMState<EXTERNAL> state(isolate); | 8403 VMState<EXTERNAL> state(isolate); |
8399 ExternalCallbackScope call_scope(isolate, callback_address); | 8404 ExternalCallbackScope call_scope(isolate, callback_address); |
8400 callback(info); | 8405 callback(info); |
8401 } | 8406 } |
8402 | 8407 |
8403 | 8408 |
8404 } // namespace internal | 8409 } // namespace internal |
8405 } // namespace v8 | 8410 } // namespace v8 |
OLD | NEW |