Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(403)

Unified Diff: src/api.cc

Issue 2541283002: [promises] Port ResolvePromise to TF (Closed)
Patch Set: fix nits Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/bootstrapper.cc » ('j') | src/js/promise.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index b435826f9a3e2321980382bf1c7038d7bb0e55bb..8798e409788a4af0dc274c305197c0a1b25f256e 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -7238,8 +7238,11 @@ bool Promise::HasHandler() {
i::Isolate* isolate = promise->GetIsolate();
LOG_API(isolate, Promise, HasRejectHandler);
ENTER_V8(isolate);
- i::Handle<i::Symbol> key = isolate->factory()->promise_has_handler_symbol();
- return i::JSReceiver::GetDataProperty(promise, key)->IsTrue(isolate);
+ if (promise->IsJSPromise()) {
+ i::Handle<i::JSPromise> js_promise = i::Handle<i::JSPromise>::cast(promise);
+ return js_promise->has_handler();
+ }
+ return false;
}
« no previous file with comments | « no previous file | src/bootstrapper.cc » ('j') | src/js/promise.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698