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

Unified Diff: compiler/java/com/google/dart/compiler/resolver/ResolutionContext.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/resolver/ResolutionContext.java
diff --git a/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java b/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java
index 4a88a5f93aab4f0480ea50c0922f6c0186a09e2a..63ae895e43907dbe0e38ac585210b1e6af962a01 100644
--- a/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java
+++ b/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java
@@ -7,11 +7,14 @@ import com.google.common.annotations.VisibleForTesting;
import com.google.dart.compiler.DartCompilationError;
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.DartFunctionExpression;
import com.google.dart.compiler.ast.DartFunctionTypeAlias;
import com.google.dart.compiler.ast.DartIdentifier;
import com.google.dart.compiler.ast.DartNode;
-import com.google.dart.compiler.ast.ASTVisitor;
import com.google.dart.compiler.ast.DartPropertyAccess;
import com.google.dart.compiler.ast.DartTypeNode;
import com.google.dart.compiler.ast.LibraryUnit;
@@ -37,7 +40,8 @@ public class ResolutionContext implements ResolutionErrorListener {
private Scope scope;
private final DartCompilerContext context;
private final CoreTypeProvider typeProvider;
-
+ private final boolean suppressSdkWarnings;
+
ResolutionContext(String name, LibraryElement library, DartCompilerContext context,
CoreTypeProvider typeProvider) {
this(new Scope(name, library), context, typeProvider);
@@ -49,6 +53,8 @@ public class ResolutionContext implements ResolutionErrorListener {
this.scope = scope;
this.context = context;
this.typeProvider = typeProvider;
+ this.suppressSdkWarnings = context.getCompilerConfiguration().getCompilerOptions()
+ .suppressSdkWarnings();
}
ResolutionContext(LibraryUnit unit, DartCompilerContext context, CoreTypeProvider typeProvider) {
@@ -350,6 +356,12 @@ public class ResolutionContext implements ResolutionErrorListener {
}
public void onError(SourceInfo sourceInfo, ErrorCode errorCode, Object... arguments) {
+ if (suppressSdkWarnings && errorCode.getErrorSeverity() == ErrorSeverity.WARNING) {
+ Source source = sourceInfo.getSource();
+ if (source != null && SystemLibraryManager.isDartUri(source.getUri())) {
+ return;
+ }
+ }
context.onError(new DartCompilationError(sourceInfo, errorCode, arguments));
}

Powered by Google App Engine
This is Rietveld 408576698