| 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 5967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5978 isolate, | 5978 isolate, |
| 5979 isolate->promise_then(), | 5979 isolate->promise_then(), |
| 5980 promise, | 5980 promise, |
| 5981 arraysize(argv), argv, | 5981 arraysize(argv), argv, |
| 5982 false).ToHandle(&result); | 5982 false).ToHandle(&result); |
| 5983 EXCEPTION_BAILOUT_CHECK(isolate, Local<Promise>()); | 5983 EXCEPTION_BAILOUT_CHECK(isolate, Local<Promise>()); |
| 5984 return Local<Promise>::Cast(Utils::ToLocal(result)); | 5984 return Local<Promise>::Cast(Utils::ToLocal(result)); |
| 5985 } | 5985 } |
| 5986 | 5986 |
| 5987 | 5987 |
| 5988 bool Promise::HasHandler() { | |
| 5989 i::Handle<i::JSObject> promise = Utils::OpenHandle(this); | |
| 5990 i::Isolate* isolate = promise->GetIsolate(); | |
| 5991 LOG_API(isolate, "Promise::HasRejectHandler"); | |
| 5992 ENTER_V8(isolate); | |
| 5993 i::Handle<i::Symbol> key = isolate->factory()->promise_has_handler_symbol(); | |
| 5994 return i::JSObject::GetDataProperty(promise, key)->IsTrue(); | |
| 5995 } | |
| 5996 | |
| 5997 | |
| 5998 bool v8::ArrayBuffer::IsExternal() const { | 5988 bool v8::ArrayBuffer::IsExternal() const { |
| 5999 return Utils::OpenHandle(this)->is_external(); | 5989 return Utils::OpenHandle(this)->is_external(); |
| 6000 } | 5990 } |
| 6001 | 5991 |
| 6002 | 5992 |
| 6003 v8::ArrayBuffer::Contents v8::ArrayBuffer::Externalize() { | 5993 v8::ArrayBuffer::Contents v8::ArrayBuffer::Externalize() { |
| 6004 i::Handle<i::JSArrayBuffer> obj = Utils::OpenHandle(this); | 5994 i::Handle<i::JSArrayBuffer> obj = Utils::OpenHandle(this); |
| 6005 Utils::ApiCheck(!obj->is_external(), | 5995 Utils::ApiCheck(!obj->is_external(), |
| 6006 "v8::ArrayBuffer::Externalize", | 5996 "v8::ArrayBuffer::Externalize", |
| 6007 "ArrayBuffer already externalized"); | 5997 "ArrayBuffer already externalized"); |
| (...skipping 1699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7707 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7697 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
| 7708 Address callback_address = | 7698 Address callback_address = |
| 7709 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7699 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 7710 VMState<EXTERNAL> state(isolate); | 7700 VMState<EXTERNAL> state(isolate); |
| 7711 ExternalCallbackScope call_scope(isolate, callback_address); | 7701 ExternalCallbackScope call_scope(isolate, callback_address); |
| 7712 callback(info); | 7702 callback(info); |
| 7713 } | 7703 } |
| 7714 | 7704 |
| 7715 | 7705 |
| 7716 } } // namespace v8::internal | 7706 } } // namespace v8::internal |
| OLD | NEW |