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

Unified Diff: src/objects.cc

Issue 1134193002: Provide accessor for object internal properties that doesn't require debugger to be active (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed gcmole failures Created 5 years, 7 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/runtime/runtime.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 8d984e34b394c61e60e8499faab736c1d9da0463..b904a04017e956a15c4fe7c26fe42730e5ff8e6a 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -112,6 +112,20 @@ bool Object::IsCallable() const {
}
+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->promise_status();
+ // Shouldn't be possible to throw here.
+ return JSObject::HasRealNamedProperty(js_object, key).FromJust();
+}
+
+
MaybeHandle<Object> Object::GetProperty(LookupIterator* it) {
for (; it->IsFound(); it->Next()) {
switch (it->state()) {
« no previous file with comments | « src/objects.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698