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

Unified Diff: Source/devtools/front_end/script_formatter_worker/ScriptFormatterWorker.js

Issue 485503002: DevTools: support getters and setters in javascript outline (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebaseline Created 6 years, 4 months 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 | « LayoutTests/inspector/sources/debugger/script-extract-outline-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/script_formatter_worker/ScriptFormatterWorker.js
diff --git a/Source/devtools/front_end/script_formatter_worker/ScriptFormatterWorker.js b/Source/devtools/front_end/script_formatter_worker/ScriptFormatterWorker.js
index b206ac5df26d45e507d5626023d9ec60518702c1..c1518c2c366ac5be5fd8462873e38ae351e7d7bb 100644
--- a/Source/devtools/front_end/script_formatter_worker/ScriptFormatterWorker.js
+++ b/Source/devtools/front_end/script_formatter_worker/ScriptFormatterWorker.js
@@ -143,7 +143,11 @@ FormatterWorker.javaScriptOutline = function(params)
*/
function processToken(tokenValue, tokenType, column, newColumn)
{
- if (isJavaScriptIdentifier(tokenType)) {
+ if (tokenType === "property" && previousTokenType === "property" && (previousToken === "get" || previousToken === "set")) {
+ currentFunction = { line: i, column: column, name: previousToken + " " + tokenValue };
+ addedFunction = true;
+ previousIdentifier = null;
+ } else if (isJavaScriptIdentifier(tokenType)) {
previousIdentifier = tokenValue;
if (tokenValue && previousToken === "function") {
// A named function: "function f...".
« no previous file with comments | « LayoutTests/inspector/sources/debugger/script-extract-outline-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698