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

Unified Diff: compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java

Issue 9702034: Removes dartc reliance on its own libraries, now can be targeted at any implementation's libraries (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: junit tests fixed Created 8 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
Index: compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
diff --git a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
index 20a0872ef41d5b2e371a63b3fd735f5a2bab8c0d..e21497a92f74f4c2826526b727848f4742d07a48 100644
--- a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
+++ b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
@@ -17,6 +17,9 @@ import com.google.dart.compiler.DartCompilationError;
import com.google.dart.compiler.DartCompilationPhase;
import com.google.dart.compiler.DartCompilerContext;
import com.google.dart.compiler.ErrorCode;
+import com.google.dart.compiler.ErrorSeverity;
+import com.google.dart.compiler.Source;
+import com.google.dart.compiler.SystemLibraryManager;
import com.google.dart.compiler.ast.ASTVisitor;
import com.google.dart.compiler.ast.DartArrayAccess;
import com.google.dart.compiler.ast.DartArrayLiteral;
@@ -180,7 +183,8 @@ public class TypeAnalyzer implements DartCompilationPhase {
private final InterfaceType functionType;
private final InterfaceType dynamicIteratorType;
private final boolean developerModeChecks;
-
+ private final boolean suppressSdkWarnings;
+
/**
* Keeps track of the number of nested catches, used to detect re-throws
* outside of any catch block.
@@ -202,6 +206,8 @@ public class TypeAnalyzer implements DartCompilationPhase {
this.nullType = typeProvider.getNullType();
this.functionType = typeProvider.getFunctionType();
this.dynamicIteratorType = typeProvider.getIteratorType(dynamicType);
+ this.suppressSdkWarnings = context.getCompilerConfiguration().getCompilerOptions()
+ .suppressSdkWarnings();
}
@VisibleForTesting
@@ -218,8 +224,14 @@ public class TypeAnalyzer implements DartCompilationPhase {
return dynamicType;
}
- private void onError(HasSourceInfo node, ErrorCode code, Object... arguments) {
- context.onError(new DartCompilationError(node, code, arguments));
+ private void onError(HasSourceInfo node, ErrorCode errorCode, Object... arguments) {
+ Source source = node.getSourceInfo().getSource();
+ if (suppressSdkWarnings && errorCode.getErrorSeverity() == ErrorSeverity.WARNING) {
+ if (source != null && SystemLibraryManager.isDartUri(source.getUri())) {
+ return;
+ }
+ }
+ context.onError(new DartCompilationError(node, errorCode, arguments));
}
AssertionError internalError(HasSourceInfo node, String message, Object... arguments) {

Powered by Google App Engine
This is Rietveld 408576698