Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 4f16120df33ddbb4d096c4a3a33820b911986833..6e1123e36bdc41992a5ae7b076fff8ab62104d0f 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -6090,16 +6090,7 @@ Local<Object> Array::CloneElementAt(uint32_t index) { |
bool Value::IsPromise() const { |
auto self = Utils::OpenHandle(this); |
- 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(); |
+ return i::Object::IsPromise(self); |
} |
@@ -7394,6 +7385,18 @@ void Debug::SetLiveEditEnabled(Isolate* isolate, bool enable) { |
} |
+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); |