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

Unified Diff: third_party/WebKit/Source/platform/v8_inspector/V8Debugger.cpp

Issue 2383683002: [DevTools] don't truncate [[Entries]] from Runtime.getProperties (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/v8_inspector/V8Debugger.cpp
diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8Debugger.cpp b/third_party/WebKit/Source/platform/v8_inspector/V8Debugger.cpp
index 4b932fabab958002ab718f0fe1e955b0dd676d78..3bc841ed5851faef664190c87a0eaf1fc2866121 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8Debugger.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8Debugger.cpp
@@ -655,12 +655,25 @@ v8::Local<v8::Value> V8Debugger::collectionEntries(v8::Local<v8::Context> contex
}
v8::Local<v8::Value> argv[] = { object };
v8::Local<v8::Value> entriesValue = callDebuggerMethod("getCollectionEntries", 1, argv).ToLocalChecked();
- v8::Local<v8::Value> copied;
- if (!copyValueFromDebuggerContext(m_isolate, debuggerContext(), context, entriesValue).ToLocal(&copied) || !copied->IsArray())
+ if (!entriesValue->IsArray())
return v8::Undefined(m_isolate);
- if (!markArrayEntriesAsInternal(context, v8::Local<v8::Array>::Cast(copied), V8InternalValueType::kEntry))
+ v8::Local<v8::Array> entries = entriesValue.As<v8::Array>();
+ v8::Local<v8::Array> copiedArray = v8::Array::New(m_isolate, entries->Length());
+ if (!copiedArray->SetPrototype(context, v8::Null(m_isolate)).FromMaybe(false))
return v8::Undefined(m_isolate);
- return copied;
+ for (uint32_t i = 0; i < entries->Length(); ++i) {
+ v8::Local<v8::Value> item;
+ if (!entries->Get(debuggerContext(), i).ToLocal(&item))
+ return v8::Undefined(m_isolate);
+ v8::Local<v8::Value> copied;
+ if (!copyValueFromDebuggerContext(m_isolate, debuggerContext(), context, item).ToLocal(&copied))
+ return v8::Undefined(m_isolate);
+ if (!createDataProperty(context, copiedArray, i, copied).FromMaybe(false))
+ return v8::Undefined(m_isolate);
+ }
+ if (!markArrayEntriesAsInternal(context, v8::Local<v8::Array>::Cast(copiedArray), V8InternalValueType::kEntry))
+ return v8::Undefined(m_isolate);
+ return copiedArray;
}
v8::Local<v8::Value> V8Debugger::generatorObjectLocation(v8::Local<v8::Context> context, v8::Local<v8::Object> object)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698