From 68642cba1880c9ea26a3020097ceea30919c99d4 Mon Sep 17 00:00:00 2001 From: allada Date: Mon, 2 May 2016 14:00:08 -0700 Subject: [PATCH] [Devtools] isTrusted in CustomEvents shown twice in console Fixed bug where isTrusted would show up twice in console when custom events were expanded. Caused because isTrusted is Unforgable which makes it both OwnProperty always and an AccessorProperty. BUG=607819 R=lushnikov Review-Url: https://codereview.chromium.org/1942883002 Cr-Commit-Position: refs/heads/master@{#391049} --- front_end/sdk/RemoteObject.js | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/front_end/sdk/RemoteObject.js b/front_end/sdk/RemoteObject.js index bba2c6e5f6..905d050a99 100644 --- a/front_end/sdk/RemoteObject.js +++ b/front_end/sdk/RemoteObject.js @@ -978,13 +978,25 @@ WebInspector.RemoteObject.loadFromObjectPerProto = function(object, callback) if (--resultCounter) return; if (savedOwnProperties && savedAccessorProperties) { - var combinedList = savedAccessorProperties.slice(0); + var propertiesMap = new Map(); + var propertySymbols = []; + for (var i = 0; i < savedAccessorProperties.length; i++) { + var property = savedAccessorProperties[i]; + if (property.symbol) + propertySymbols.push(property); + else + propertiesMap.set(property.name, property); + } for (var i = 0; i < savedOwnProperties.length; i++) { var property = savedOwnProperties[i]; - if (!property.isAccessorProperty()) - combinedList.push(property); + if (property.isAccessorProperty()) + continue; + if (property.symbol) + propertySymbols.push(property); + else + propertiesMap.set(property.name, property); } - return callback(combinedList, savedInternalProperties ? savedInternalProperties : null); + return callback(propertiesMap.valuesArray().concat(propertySymbols), savedInternalProperties ? savedInternalProperties : null); } else { callback(null, null); }