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

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

Issue 2823233004: DevTools: make JSFormatter aware of parenthesized expressions (Closed)
Patch Set: ac Created 3 years, 8 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/ESTreeWalker.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 640ddb4dd534197f0f54b0f62a78dca769d07885..116e06c77e6fbd597e6e42715ebfbd97d8690f91 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
@@ -51,7 +51,7 @@ FormatterWorker.JavaScriptFormatter = class {
this._content = text.substring(this._fromOffset, this._toOffset);
this._lastLineNumber = 0;
this._tokenizer = new FormatterWorker.AcornTokenizer(this._content);
- var ast = acorn.parse(this._content, {ranges: false, ecmaVersion: 8});
+ var ast = acorn.parse(this._content, {ranges: false, ecmaVersion: 8, preserveParens: true});
var walker = new FormatterWorker.ESTreeWalker(this._beforeVisit.bind(this), this._afterVisit.bind(this));
walker.walk(ast);
}
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/formatter_worker/ESTreeWalker.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698