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

Unified Diff: third_party/WebKit/Source/platform/v8_inspector/InjectedScriptSource.js

Issue 2102453003: [DevTools] Move collectionEntries to internalProperties in protocol (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
Index: third_party/WebKit/Source/platform/v8_inspector/InjectedScriptSource.js
diff --git a/third_party/WebKit/Source/platform/v8_inspector/InjectedScriptSource.js b/third_party/WebKit/Source/platform/v8_inspector/InjectedScriptSource.js
index 0e0c4f8d28065b05a5f348091ce7784c29cfe994..728d2d4714798b01f3913ebb7cfd871f677cda89 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/InjectedScriptSource.js
+++ b/third_party/WebKit/Source/platform/v8_inspector/InjectedScriptSource.js
@@ -635,10 +635,29 @@ InjectedScript.prototype = {
}
}
+ if (subtype === "internal#entry") {
+ if ("key" in obj)
+ return "{" + this._describeEverything(obj.key) + " => " + this._describeEverything(obj.value) + "}";
+ return this._describeEverything(obj.value);
+ }
+
return className;
},
/**
+ * @param {*} obj
+ * @return {string}
+ */
+ _describeEverything: function(value)
dgozman 2016/06/28 18:58:08 _describeIncludingPrimitives
kozy 2016/06/28 20:55:46 Done.
+ {
+ if (typeof value === "string")
+ return "\"" + value.replace(/\n/g, "\u21B5") + "\"";
+ if (value === null)
+ return "" + value;
+ return this.isPrimitiveValue(value) ? toStringDescription(value) : this._describe(value);
+ },
+
+ /**
* @param {boolean} enabled
*/
setCustomObjectFormatterEnabled: function(enabled)
@@ -827,7 +846,12 @@ InjectedScript.RemoteObject.prototype = {
// Add internal properties to preview.
var rawInternalProperties = InjectedScriptHost.getInternalProperties(object) || [];
var internalProperties = [];
+ var entries = null;
for (var i = 0; i < rawInternalProperties.length; i += 2) {
+ if (rawInternalProperties[i] === "[[Entries]]") {
+ entries = /** @type {!Array<*>} */(rawInternalProperties[i + 1]);
+ continue;
+ }
push(internalProperties, {
name: rawInternalProperties[i],
value: rawInternalProperties[i + 1],
@@ -839,7 +863,7 @@ InjectedScript.RemoteObject.prototype = {
this._appendPropertyDescriptors(preview, internalProperties, propertiesThreshold, secondLevelKeys, isTable);
if (this.subtype === "map" || this.subtype === "set" || this.subtype === "iterator")
- this._appendEntriesPreview(object, preview, skipEntriesPreview);
+ this._appendEntriesPreview(entries, preview, skipEntriesPreview);
} catch (e) {}
@@ -947,13 +971,12 @@ InjectedScript.RemoteObject.prototype = {
},
/**
- * @param {!Object} object
+ * @param {?Array<*>} entries
* @param {!RuntimeAgent.ObjectPreview} preview
* @param {boolean=} skipEntriesPreview
*/
- _appendEntriesPreview: function(object, preview, skipEntriesPreview)
+ _appendEntriesPreview: function(entries, preview, skipEntriesPreview)
{
- var entries = InjectedScriptHost.collectionEntries(object);
if (!entries)
return;
if (skipEntriesPreview) {

Powered by Google App Engine
This is Rietveld 408576698