From b7f8409b1f0f596a5bf75574988e6975b2a6a9ef Mon Sep 17 00:00:00 2001 From: kozyatinskiy Date: Wed, 9 Mar 2016 16:18:50 -0800 Subject: [PATCH] [DevTools] Strip "get" and "set" prefixes when describing functions This restores the behavior of the devtools's output, with respect to getter and setter functions, to what it was before V8 enabled ES2015 Function.name reform. The test changes in this patch are strict reverts of the changes in the recent rebaseline: http://crrev.com/8ab4acafc5a378ea754be3caec9da13473059e82. BUG=588803 R=pfeldman@chromium.org,adamk@chromium.org Review URL: https://codereview.chromium.org/1779463003 Cr-Commit-Position: refs/heads/master@{#380269} --- front_end/components/ObjectPropertiesSection.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/front_end/components/ObjectPropertiesSection.js b/front_end/components/ObjectPropertiesSection.js index c5e9f3026c..9592a28e76 100644 --- a/front_end/components/ObjectPropertiesSection.js +++ b/front_end/components/ObjectPropertiesSection.js @@ -1055,13 +1055,14 @@ WebInspector.ObjectPropertiesSection.createNameElement = function(name) */ WebInspector.ObjectPropertiesSection.valueTextForFunctionDescription = function(description) { - var matches = /function\s([^)]*)/.exec(description); + var text = description.replace(/^function [gs]et /, "function "); + var matches = /function\s([^)]*)/.exec(text); if (!matches) { // process shorthand methods - matches = /[^(]*(\([^)]*)/.exec(description); + matches = /[^(]*(\([^)]*)/.exec(text); } var match = matches ? matches[1] : null; - return match ? match.replace(/\n/g, " ") + ")" : (description || ""); + return match ? match.replace(/\n/g, " ") + ")" : (text || ""); } /** @@ -1335,4 +1336,4 @@ WebInspector.ObjectPropertiesSectionExpandController.prototype = { treeElement[WebInspector.ObjectPropertiesSectionExpandController._cachedPathSymbol] = result; return result; } -} \ No newline at end of file +}