Index: third_party/WebKit/Source/devtools/front_end/components_lazy/CookiesTable.js |
diff --git a/third_party/WebKit/Source/devtools/front_end/components_lazy/CookiesTable.js b/third_party/WebKit/Source/devtools/front_end/components_lazy/CookiesTable.js |
index efa8d8f82294463ea6c3b4cd018254fad137ef07..9fe4e6de1f9ff5d36fdb52d5d44006d2783d7b5c 100644 |
--- a/third_party/WebKit/Source/devtools/front_end/components_lazy/CookiesTable.js |
+++ b/third_party/WebKit/Source/devtools/front_end/components_lazy/CookiesTable.js |
@@ -211,13 +211,21 @@ Components.CookiesTable = class extends UI.VBox { |
var sortDirection = this._dataGrid.isSortOrderAscending() ? 1 : -1; |
/** |
+ * @param {!SDK.Cookie} cookie |
+ * @param {string} property |
+ * @return {string} |
+ */ |
+ function getValue(cookie, property) { |
+ return typeof cookie[property] === 'function' ? String(cookie[property]()) : String(cookie.name()); |
+ } |
+ |
+ /** |
* @param {string} property |
* @param {!SDK.Cookie} cookie1 |
* @param {!SDK.Cookie} cookie2 |
*/ |
function compareTo(property, cookie1, cookie2) { |
- return sortDirection * |
- (String(cookie1[property] || cookie1['name'])).compareTo(String(cookie2[property] || cookie2['name'])); |
+ return sortDirection * getValue(cookie1, property).compareTo(getValue(cookie2, property)); |
} |
/** |