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

Unified Diff: third_party/WebKit/Source/devtools/front_end/components/RemoteObjectPreviewFormatter.js

Issue 2486953002: DevTools: sort functions last in object previews (Closed)
Patch Set: ac Created 4 years, 1 month 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/devtools/front_end/components/RemoteObjectPreviewFormatter.js
diff --git a/third_party/WebKit/Source/devtools/front_end/components/RemoteObjectPreviewFormatter.js b/third_party/WebKit/Source/devtools/front_end/components/RemoteObjectPreviewFormatter.js
index bf04fa8cbaa45c78f43ab8631d38dd63ff71bf88..dc6e0ace04f86ec7f7cb7ecb7d743b31d1823f6b 100644
--- a/third_party/WebKit/Source/devtools/front_end/components/RemoteObjectPreviewFormatter.js
+++ b/third_party/WebKit/Source/devtools/front_end/components/RemoteObjectPreviewFormatter.js
@@ -46,6 +46,20 @@ WebInspector.RemoteObjectPreviewFormatter = class {
var properties = preview.properties;
if (isArray)
properties = properties.slice().stableSort(compareIndexesFirst);
+ else
+ properties = properties.slice().stableSort(compareFunctionsLast);
+
+ /**
+ * @param {!RuntimeAgent.PropertyPreview} a
+ * @param {!RuntimeAgent.PropertyPreview} b
+ */
+ function compareFunctionsLast(a, b) {
+ if (a.type !== 'function' && b.type === 'function')
+ return -1;
+ if (a.type === 'function' && b.type !== 'function')
+ return 1;
+ return 0;
+ }
/**
* @param {!RuntimeAgent.PropertyPreview} a
« 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