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 7249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7260 void Promise::Resolver::Resolve(Local<Value> value) { | 7260 void Promise::Resolver::Resolve(Local<Value> value) { |
7261 auto context = ContextFromHeapObject(Utils::OpenHandle(this)); | 7261 auto context = ContextFromHeapObject(Utils::OpenHandle(this)); |
7262 USE(Resolve(context, value)); | 7262 USE(Resolve(context, value)); |
7263 } | 7263 } |
7264 | 7264 |
7265 | 7265 |
7266 Maybe<bool> Promise::Resolver::Reject(Local<Context> context, | 7266 Maybe<bool> Promise::Resolver::Reject(Local<Context> context, |
7267 Local<Value> value) { | 7267 Local<Value> value) { |
7268 PREPARE_FOR_EXECUTION_PRIMITIVE(context, Promise_Resolver, Resolve, bool); | 7268 PREPARE_FOR_EXECUTION_PRIMITIVE(context, Promise_Resolver, Resolve, bool); |
7269 auto self = Utils::OpenHandle(this); | 7269 auto self = Utils::OpenHandle(this); |
7270 i::Handle<i::Object> argv[] = {self, Utils::OpenHandle(*value)}; | 7270 i::Handle<i::Object> argv[] = {self, Utils::OpenHandle(*value), |
7271 isolate->factory()->ToBoolean(true)}; | |
adamk
2017/01/13 21:43:37
Please add a comment for what true means here.
gsathya
2017/01/13 22:34:46
Done.
| |
7271 has_pending_exception = | 7272 has_pending_exception = |
7272 i::Execution::Call(isolate, isolate->promise_reject(), | 7273 i::Execution::Call(isolate, isolate->promise_internal_reject(), |
7273 isolate->factory()->undefined_value(), arraysize(argv), | 7274 isolate->factory()->undefined_value(), arraysize(argv), |
7274 argv) | 7275 argv) |
7275 .is_null(); | 7276 .is_null(); |
7276 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); | 7277 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); |
7277 return Just(true); | 7278 return Just(true); |
7278 } | 7279 } |
7279 | 7280 |
7280 | 7281 |
7281 void Promise::Resolver::Reject(Local<Value> value) { | 7282 void Promise::Resolver::Reject(Local<Value> value) { |
7282 auto context = ContextFromHeapObject(Utils::OpenHandle(this)); | 7283 auto context = ContextFromHeapObject(Utils::OpenHandle(this)); |
(...skipping 2705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
9988 Address callback_address = | 9989 Address callback_address = |
9989 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 9990 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
9990 VMState<EXTERNAL> state(isolate); | 9991 VMState<EXTERNAL> state(isolate); |
9991 ExternalCallbackScope call_scope(isolate, callback_address); | 9992 ExternalCallbackScope call_scope(isolate, callback_address); |
9992 callback(info); | 9993 callback(info); |
9993 } | 9994 } |
9994 | 9995 |
9995 | 9996 |
9996 } // namespace internal | 9997 } // namespace internal |
9997 } // namespace v8 | 9998 } // namespace v8 |
OLD | NEW |