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

Unified Diff: src/api.cc

Issue 1133243002: Revert of 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: 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 | « include/v8-debug.h ('k') | src/bootstrapper.cc » ('j') | no next file with comments »
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 6e1123e36bdc41992a5ae7b076fff8ab62104d0f..4f16120df33ddbb4d096c4a3a33820b911986833 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -6090,7 +6090,16 @@
bool Value::IsPromise() const {
auto self = Utils::OpenHandle(this);
- return i::Object::IsPromise(self);
+ if (!self->IsJSObject()) return false;
+ auto js_object = i::Handle<i::JSObject>::cast(self);
+ // 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 i::JSObject::HasRealNamedProperty(js_object, key).FromJust();
}
@@ -7385,18 +7394,6 @@
}
-MaybeLocal<Array> Debug::GetInternalProperties(Isolate* v8_isolate,
- Local<Value> value) {
- i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
- ENTER_V8(isolate);
- i::Handle<i::Object> val = Utils::OpenHandle(*value);
- i::Handle<i::JSArray> result;
- if (!i::Runtime::GetInternalProperties(isolate, val).ToHandle(&result))
- return MaybeLocal<Array>();
- return Utils::ToLocal(result);
-}
-
-
Handle<String> CpuProfileNode::GetFunctionName() const {
i::Isolate* isolate = i::Isolate::Current();
const i::ProfileNode* node = reinterpret_cast<const i::ProfileNode*>(this);
« no previous file with comments | « include/v8-debug.h ('k') | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698