Chromium Code Reviews| Index: third_party/WebKit/Source/platform/v8_inspector/V8DebuggerImpl.cpp |
| diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerImpl.cpp b/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerImpl.cpp |
| index 27396fc72dce1c85dde16cfdafd4226bebdd7ded..811f20c4bfa055e37ece8aec2cd42babe98eb110 100644 |
| --- a/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerImpl.cpp |
| +++ b/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerImpl.cpp |
| @@ -37,6 +37,7 @@ |
| #include "platform/v8_inspector/ScriptBreakpoint.h" |
| #include "platform/v8_inspector/V8Compat.h" |
| #include "platform/v8_inspector/V8DebuggerAgentImpl.h" |
| +#include "platform/v8_inspector/V8InjectedScriptHost.h" |
| #include "platform/v8_inspector/V8InspectorSessionImpl.h" |
| #include "platform/v8_inspector/V8RuntimeAgentImpl.h" |
| #include "platform/v8_inspector/V8StackTraceImpl.h" |
| @@ -664,6 +665,31 @@ v8::MaybeLocal<v8::Value> V8DebuggerImpl::functionScopes(v8::Local<v8::Function> |
| return callDebuggerMethod("getFunctionScopes", 1, argv); |
| } |
| +v8::MaybeLocal<v8::Array> V8DebuggerImpl::internalProperties(v8::Local<v8::Context> context, v8::Local<v8::Value> value) |
| +{ |
| + v8::Local<v8::Array> properties; |
| + if (!v8::Debug::GetInternalProperties(m_isolate, value).ToLocal(&properties)) |
| + return v8::MaybeLocal<v8::Array>(); |
| + if (!enabled()) |
| + return properties; |
| + if (value->IsMap() || value->IsWeakMap() || value->IsSet() || value->IsWeakSet() || value->IsSetIterator() || value->IsMapIterator()) { |
|
dgozman
2016/06/28 18:58:09
Let's move if body into collectionEntries.
kozy
2016/06/28 20:55:46
Done.
|
| + v8::Local<v8::Value> entriesArray = collectionEntries(v8::Local<v8::Object>::Cast(value)); |
| + if (entriesArray->IsArray()) { |
| + v8::Local<v8::Array> entries = entriesArray.As<v8::Array>(); |
| + properties->Set(properties->Length(), v8InternalizedString("[[Entries]]")); |
| + properties->Set(properties->Length(), entries); |
| + for (size_t i = 0; i < entries->Length(); ++i) { |
| + v8::Local<v8::Value> entry; |
| + if (!entries->Get(context, i).ToLocal(&entry) || !entry->IsObject()) |
| + continue; |
| + if (!entry.As<v8::Object>()->SetPrivate(context, V8InjectedScriptHost::internalEntryPrivate(m_isolate), v8::Boolean::New(m_isolate, true)).FromMaybe(false)) |
| + continue; |
| + } |
| + } |
| + } |
| + return properties; |
| +} |
| + |
| v8::Local<v8::Value> V8DebuggerImpl::generatorObjectDetails(v8::Local<v8::Object>& object) |
| { |
| if (!enabled()) { |
| @@ -674,7 +700,7 @@ v8::Local<v8::Value> V8DebuggerImpl::generatorObjectDetails(v8::Local<v8::Object |
| return callDebuggerMethod("getGeneratorObjectDetails", 1, argv).ToLocalChecked(); |
| } |
| -v8::Local<v8::Value> V8DebuggerImpl::collectionEntries(v8::Local<v8::Object>& object) |
| +v8::Local<v8::Value> V8DebuggerImpl::collectionEntries(v8::Local<v8::Object> object) |
| { |
| if (!enabled()) { |
| NOTREACHED(); |