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

Unified Diff: third_party/closure_compiler/runner/src/org/chromium/closure/compiler/ChromeCodingConvention.java

Issue 1409843002: Make Closure Compiler understand assertNotReached (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
Index: third_party/closure_compiler/runner/src/org/chromium/closure/compiler/ChromeCodingConvention.java
diff --git a/third_party/closure_compiler/runner/src/org/chromium/closure/compiler/ChromeCodingConvention.java b/third_party/closure_compiler/runner/src/org/chromium/closure/compiler/ChromeCodingConvention.java
index 396ae828c130e8ba4bbc017235d44fbb6b5013c8..7eadc53fbbf043b396dfd90e6114bda8d31c3f1f 100644
--- a/third_party/closure_compiler/runner/src/org/chromium/closure/compiler/ChromeCodingConvention.java
+++ b/third_party/closure_compiler/runner/src/org/chromium/closure/compiler/ChromeCodingConvention.java
@@ -67,4 +67,21 @@ public class ChromeCodingConvention extends CodingConventions.Proxy {
new AssertInstanceofSpec("cr.ui.decorate")
);
}
+
+ // TODO(dbeam): combine this with ClosureCodingConvention?
+ @Override
+ public boolean isFunctionCallThatAlwaysThrows(Node n) {
+ if (n.isExprResult()) {
+ if (!n.getFirstChild().isCall()) {
+ return false;
+ }
+ } else if (!n.isCall()) {
+ return false;
+ }
+ if (n.isExprResult()) {
+ n = n.getFirstChild();
+ }
+ // n is a call
+ return n.getFirstChild().matchesQualifiedName("assertNotReached");
+ }
}

Powered by Google App Engine
This is Rietveld 408576698