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

Unified Diff: third_party/WebKit/Source/devtools/front_end/formatter_worker/JavaScriptFormatter.js

Issue 1835783002: DevTools: simplify WI.FormattedContentBuilder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebaseline tests Created 4 years, 9 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 | « third_party/WebKit/Source/devtools/front_end/formatter_worker/IdentityFormatter.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/formatter_worker/JavaScriptFormatter.js
diff --git a/third_party/WebKit/Source/devtools/front_end/formatter_worker/JavaScriptFormatter.js b/third_party/WebKit/Source/devtools/front_end/formatter_worker/JavaScriptFormatter.js
index 7a8c611aa5e071b189b817995990ae80817d0629..6a61ddce29e9fba441393a791851e0ee59d6f30c 100644
--- a/third_party/WebKit/Source/devtools/front_end/formatter_worker/JavaScriptFormatter.js
+++ b/third_party/WebKit/Source/devtools/front_end/formatter_worker/JavaScriptFormatter.js
@@ -46,7 +46,6 @@ WebInspector.JavaScriptFormatter.prototype = {
*/
format: function(text, lineEndings, fromOffset, toOffset)
{
- this._lineOffset = lineEndings.lowerBound(fromOffset);
this._fromOffset = fromOffset;
this._toOffset = toOffset;
this._content = text.substring(this._fromOffset, this._toOffset);
@@ -74,7 +73,7 @@ WebInspector.JavaScriptFormatter.prototype = {
else if (format[i] === "<")
this._builder.decreaseNestingLevel();
else if (format[i] === "t")
- this._builder.addToken(this._content.substring(token.start, token.end), this._fromOffset + token.start, this._lineOffset + this._tokenizer.tokenLineStart(), this._lineOffset + this._tokenizer.tokenLineEnd());
+ this._builder.addToken(this._content.substring(token.start, token.end), this._fromOffset + token.start);
}
},
@@ -132,7 +131,7 @@ WebInspector.JavaScriptFormatter.prototype = {
if (AT.lineComment(token))
return "tn";
if (AT.blockComment(token))
- return "t";
+ return "tn";
if (node.type === "ContinueStatement" || node.type === "BreakStatement") {
return node.label && AT.keyword(token) ? "ts" : "t";
} else if (node.type === "Identifier") {
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/formatter_worker/IdentityFormatter.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698