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

Unified Diff: pkg/analyzer/lib/src/generated/resolver.dart

Issue 1265453005: Code clean-up, mostly constructors (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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 | « pkg/analyzer/lib/src/generated/html.dart ('k') | pkg/analyzer/lib/src/generated/scanner.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index 49fc6c797dbba3b06d1751515bcc705ed477f46f..4e5138857c854b9dde59f4bcd249de6849d4c27a 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -4758,12 +4758,7 @@ class HtmlTagInfo {
* @param classToTagsMap a table mapping the classes defined in the HTML file to an array
* containing the names of tags with that class
*/
- HtmlTagInfo(List<String> allTags, HashMap<String, String> idToTagMap,
- HashMap<String, List<String>> classToTagsMap) {
- this.allTags = allTags;
- this.idToTagMap = idToTagMap;
- this.classToTagsMap = classToTagsMap;
- }
+ HtmlTagInfo(this.allTags, this.idToTagMap, this.classToTagsMap);
/**
* Return an array containing the tags that have the given class, or {@code null} if there are no
@@ -11150,7 +11145,7 @@ class ResolverVisitor extends ScopedVisitor {
// If the expectedClosureType is not more specific than the static type,
// return.
DartType staticClosureType =
- (closure.element != null ? closure.element.type : null) as DartType;
+ closure.element != null ? closure.element.type : null;
if (staticClosureType != null &&
!expectedClosureType.isMoreSpecificThan(staticClosureType)) {
return;
@@ -11640,7 +11635,7 @@ abstract class ScopedVisitor extends UnifyingAstVisitor<Object> {
/**
* The element for the library containing the compilation unit being visited.
*/
- LibraryElement _definingLibrary;
+ final LibraryElement definingLibrary;
/**
* The source representing the compilation unit being visited.
@@ -11650,7 +11645,7 @@ abstract class ScopedVisitor extends UnifyingAstVisitor<Object> {
/**
* The error listener that will be informed of any errors that are found during resolution.
*/
- AnalysisErrorListener _errorListener;
+ final AnalysisErrorListener errorListener;
/**
* The scope used to resolve identifiers.
@@ -11694,10 +11689,9 @@ abstract class ScopedVisitor extends UnifyingAstVisitor<Object> {
* first be visited. If `null` or unspecified, a new [LibraryScope] will be
* created based on [definingLibrary] and [typeProvider].
*/
- ScopedVisitor(LibraryElement definingLibrary, this.source, this.typeProvider,
- AnalysisErrorListener errorListener, {Scope nameScope}) {
- this._definingLibrary = definingLibrary;
- this._errorListener = errorListener;
+ ScopedVisitor(
+ this.definingLibrary, this.source, this.typeProvider, this.errorListener,
+ {Scope nameScope}) {
if (nameScope == null) {
this.nameScope = new LibraryScope(definingLibrary, errorListener);
} else {
@@ -11706,13 +11700,6 @@ abstract class ScopedVisitor extends UnifyingAstVisitor<Object> {
}
/**
- * Return the library element for the library containing the compilation unit being resolved.
- *
- * @return the library element for the library containing the compilation unit being resolved
- */
- LibraryElement get definingLibrary => _definingLibrary;
-
- /**
* Return the implicit label scope in which the current node is being
* resolved.
*/
@@ -11748,7 +11735,7 @@ abstract class ScopedVisitor extends UnifyingAstVisitor<Object> {
*/
void reportErrorForNode(ErrorCode errorCode, AstNode node,
[List<Object> arguments]) {
- _errorListener.onError(new AnalysisError(
+ errorListener.onError(new AnalysisError(
source, node.offset, node.length, errorCode, arguments));
}
@@ -11762,7 +11749,7 @@ abstract class ScopedVisitor extends UnifyingAstVisitor<Object> {
*/
void reportErrorForOffset(ErrorCode errorCode, int offset, int length,
[List<Object> arguments]) {
- _errorListener.onError(
+ errorListener.onError(
new AnalysisError(source, offset, length, errorCode, arguments));
}
@@ -11775,7 +11762,7 @@ abstract class ScopedVisitor extends UnifyingAstVisitor<Object> {
*/
void reportErrorForToken(ErrorCode errorCode, sc.Token token,
[List<Object> arguments]) {
- _errorListener.onError(new AnalysisError(
+ errorListener.onError(new AnalysisError(
source, token.offset, token.length, errorCode, arguments));
}
« no previous file with comments | « pkg/analyzer/lib/src/generated/html.dart ('k') | pkg/analyzer/lib/src/generated/scanner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698