Skip to content

Commit

Permalink
[DevTools] Strip "get" and "set" prefixes when describing functions
Browse files Browse the repository at this point in the history
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
[email protected],[email protected]

Review URL: https://codereview.chromium.org/1779463003

Cr-Commit-Position: refs/heads/master@{#380269}
  • Loading branch information
alexkozy authored and Commit bot committed Mar 10, 2016
1 parent 3dfedf8 commit b7f8409
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions front_end/components/ObjectPropertiesSection.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 || "");
}

/**
Expand Down Expand Up @@ -1335,4 +1336,4 @@ WebInspector.ObjectPropertiesSectionExpandController.prototype = {
treeElement[WebInspector.ObjectPropertiesSectionExpandController._cachedPathSymbol] = result;
return result;
}
}
}

0 comments on commit b7f8409

Please sign in to comment.