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

Unified Diff: src/objects.cc

Issue 2091243002: Use the instance type to determine if an object is a promise. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@SimplifyIsError
Patch Set: Rebase Created 4 years, 6 months 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 | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 2130e6ca939dad2dcc88a6dcd90f60ed27e06c70..7d58f29f3c9bc2cd8e6a9b8e3eeb83b3246331fe 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -670,20 +670,6 @@ Maybe<bool> Object::IsArray(Handle<Object> object) {
}
-bool Object::IsPromise(Handle<Object> object) {
- if (!object->IsJSObject()) return false;
- auto js_object = Handle<JSObject>::cast(object);
- // Promises can't have access checks.
- if (js_object->map()->is_access_check_needed()) return false;
- auto isolate = js_object->GetIsolate();
- // TODO(dcarney): this should just be read from the symbol registry so as not
- // to be context dependent.
- auto key = isolate->factory()->promise_state_symbol();
- // Shouldn't be possible to throw here.
- return JSObject::HasRealNamedProperty(js_object, key).FromJust();
-}
-
-
// static
MaybeHandle<Object> Object::GetMethod(Handle<JSReceiver> receiver,
Handle<Name> name) {
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698