Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index c147632f2e173b4a9ad1480158b5db97f84f7e21..d962338198d9b9fb3452f18ea2719aa0d86bea48 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); |